This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author arigo
Recipients arigo, asvetlov, barry, daniel.urban, nadeem.vawda, ncoghlan, pitrou
Date 2011-09-02.05:33:00
SpamBayes Score 6.0811817e-05
Marked as misclassified No
Message-id <1314941581.69.0.473849794886.issue12850@psf.upfronthosting.co.za>
In-reply-to
Content
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);
History
Date User Action Args
2011-09-02 05:33:01arigosetrecipients: + arigo, barry, ncoghlan, pitrou, nadeem.vawda, asvetlov, daniel.urban
2011-09-02 05:33:01arigosetmessageid: <1314941581.69.0.473849794886.issue12850@psf.upfronthosting.co.za>
2011-09-02 05:33:01arigolinkissue12850 messages
2011-09-02 05:33:00arigocreate