
Making a C codebase reentrant by turning it into a big C++ object - fogus
http://phildawes.net/blog/2009/09/21/c-codebase-reentrant/
======
sreque
The author didn't, as far as I understand, make the code reentrant. The code
still operates on mutable state outside of the scope of the call such that two
calls that pass in the same inputs may produce different results. The author
simply refactored global variables into instance variables of a class,
allowing him to create multiple instances of his original program's state.

Interesting to read nonetheless.

~~~
phildawes
There's every chance I'm being sloppy with the term reentrant. The factor vm
obviously isn't functionally-pure as it accepts user input so I guess it can't
be called reentrant by that definition. You can start multiple copies of the
program running in different threads though.

