3 ms·
Detection will be non-trivial. On the other hand, it could be a simple command line option, like specifying the number of cores you want your program to run on.
by sanxiyn 15y ago
Detection will be non-trivial. On the other hand, it could be a simple command line option, like specifying the number of cores you want your program to run on.
- ori_b 15y agoI'm not sure about that. If you hook thread creation into invalidating the code that was was JITted without STM, you might be able to handle it reasonably well. Of course, the slow path would just use STM all the time.
- sanxiyn 15y ago> ... invalidating the code that was JITted ... I mean, that is non-trivial.
- ori_b 15y agoMaybe. If you determine that you only need to do it on spawning the first thread, and never go back, then you can probably spare the expense of throwing out ALL of the jit cache and starting from nothing.
- chimeracoder 15y agoNot really - we already have __future__ imports, which must be declared at the top of the file before any other modules. I think this could be achieved in a simple way in a similar fashion - some sort of a straightforward 'multithreaded' pragma shouldn't be too much of a burden.
- sanxiyn 15y ago__future__ is per-module, so while it is good for syntax changes, I think it is inappropriate for runtime pragmas.