David D.W. Downey wrote:
> Aboslutely fragging GREAT! I think I've become able to understand more
> about certain things in the last 5 minutes than I have in quite awhile.
Warm fuzzies.
> The only thing I don't understand is the term re-entrant.
>
> re-entrant == re enter a function o something? as in NOT doing this or
> MUST be able to do this? and why is that a bad thing(tm)?
This is an old concept. Essentially, if you don't take some pains to
guarantee that the function can support such usage, it's possible to
cause severe heartburn if you call a function from itself, or from some
other function that was called by it (and/or deeper in such a chain.)
A good example of things that break reentrancy is declaration of static
variables within a function, without making provision for being called
while they're in use. E.g., a static array and static depth index, bumped
whenever the function is called and decremented on exit, would help
fix reentrancy for data that might have to be shared with later instantiations
of yourself. If you don't need to share the data, stack-resident data nicely
avoids the issue. Another item is partially modifying global data (boo,
hiss--but another topic), then calling something that re-enters yourself.
You now have left that data in an "inconsistent" state.
It's not exceedingly difficult; but it's easy to forget to consider data
usage with it in mind.
Cheers,
--
Dave Ihnat
[EMAIL PROTECTED]
--
To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe"
as the Subject.