2 ms·
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 call
by sreque 17y ago
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.
- dryicerx 17y agoAt the last paragraph he mentions he did make the code reentrant, just not getting in to detail... I was also reading in hopes of how he changed that :/
- phildawes 17y agoThere'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.