Note that there are some explanatory texts on larger screens.

plurals
  1. POWhat exactly is a reentrant function?
    primarykey
    data
    text
    <p><a href="https://stackoverflow.com/questions/1435541/is-this-function-reentrant/1435561#1435561">Most</a> <a href="https://stackoverflow.com/questions/856823/threadsafe-vs-re-entrant/856856#856856">of</a> <a href="https://stackoverflow.com/questions/1435541/is-this-function-reentrant/1435577#1435577">the</a> <a href="https://stackoverflow.com/questions/2441351/what-is-a-re-entrant-parser/2441401#2441401">times</a>, the definition of reentrance is quoted from <a href="http://en.wikipedia.org/wiki/Reentrant_%28subroutine%29" rel="noreferrer">Wikipedia</a>:</p> <blockquote> <p>A computer program or routine is described as reentrant if it can be <strong><em>safely</em></strong> called again before its previous invocation has been completed (i.e it can be safely executed concurrently). To be reentrant, a computer program or routine:</p> <ol> <li>Must hold no static (or global) non-constant data. </li> <li>Must not return the address to static (or global) non-constant data. </li> <li>Must work only on the data provided to it by the caller. </li> <li>Must not rely on locks to singleton resources. </li> <li>Must not modify its own code (unless executing in its own unique thread storage) </li> <li>Must not call non-reentrant computer programs or routines.</li> </ol> </blockquote> <p>How is <strong><em>safely</em></strong> defined? </p> <p>If a program can be <strong><em>safely executed concurrently</em></strong>, does it always mean that it is reentrant?</p> <p>What exactly is the common thread between the six points mentioned that I should keep in mind while checking my code for reentrant capabilities?</p> <p>Also,</p> <ol> <li>Are all recursive functions reentrant?</li> <li>Are all thread-safe functions reentrant?</li> <li>Are all recursive and thread-safe functions reentrant?</li> </ol> <hr> <p>While writing this question, one thing comes to mind: Are the terms like <strong>reentrance</strong> and <strong>thread safety</strong> absolute at all i.e. do they have fixed concrete definations? For, if they are not, this question is not very meaningful.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload