Re: Using Py_AddPendingCall

2012-09-17 Thread Antoine Pitrou
css322 gmail.com> writes: > > (1) A worker thread calls Py_AddPendingCall and assigns a handler function. > (2) When the Python interpreter runs, it calls the handler function whenever it yields control to another thread Not exactly. As the documentation says: "If successful, func will be called

Using Py_AddPendingCall

2012-09-16 Thread css322
I have an embedded Python program which runs in a thread in C. When the Python interpreter switches thread context (yielding control to another thread), I'd like to be notified so I can perform certain necessary operations. It seems that Py_AddPendingCall is exactly what I'm looking for. Howeve