Message143379
Antoine: we could take two lines from the current implementation of these hook from stm/transactionmodule.c, and move them to the interpreter core. CPython would end up with containing the core logic for transactions. A possible API would look like that:
/* stops all threads different from 'tstate' at their next
bytecode, at which point the given callback is invoked */
_PyEval_SetThreadStopper(PyThreadState *tstate, void (*callback)(void));
Such a function can also be tested in CPython, e.g. with ctypes. Still maybe a different name would be better, like _PyEval_InternalThreadStopper(). Or, if that's still a callback too much:
/* stops all threads different from 'tstate' at their next bytecode,
at which point they wait for the 'lock' to be available */
_PyEval_SetThreadStopper(PyThreadState *tstate, PyThread_lock_type lock); |
|
Date |
User |
Action |
Args |
2011-09-02 05:33:01 | arigo | set | recipients:
+ arigo, barry, ncoghlan, pitrou, nadeem.vawda, asvetlov, daniel.urban |
2011-09-02 05:33:01 | arigo | set | messageid: <1314941581.69.0.473849794886.issue12850@psf.upfronthosting.co.za> |
2011-09-02 05:33:01 | arigo | link | issue12850 messages |
2011-09-02 05:33:00 | arigo | create | |
|