[Wolves] Re-entrancy in C. (Peter oliver should stop being rimmed and talk to me)

bambam at opendildonics.org bambam at opendildonics.org
Fri Oct 24 18:43:48 BST 2003


How do I make my C libraries reentrant?

Presumably I change the API to accept a pointer to any
objects which should be "instance" variables - so that you
may "re-enter" the library anywhere. Correct?

Also, does correct re-entrancy imply thread-safe? Surely if
the code does not access any global variables within the
library (are these "class" variables?) then threads using
the library don't collide.

Were I writing this in Java I would easily be able to
differenciate between them from the class definition, but
I'm not sure of how the ideas pervade C.

How does static code relate to the whole thing? It seems as
though if an object file within the shared library file
declared a potentially global variable as static, only that
part of the shared object can access it, but this whole idea
still fucks up re-entrancy.

Needed for maximum evil open source general release library
construction. Help will be acknowledged.

Thankyou in advance for your replies :-)

bambam

-- 
Cannot access memory at address 0x41414141




More information about the Wolves mailing list