Embed python in multi-thread environment

Martin v. Loewis martin at v.loewis.de
Sun Jun 9 15:50:02 EDT 2002


Arlo <arlo.maillist at ozmaker.com> writes:

> it seems i can't call PyObject_CallObject twice at the same process?

You can, but you must hold the GIL while doing so. In each thread,
allocate a thread state (perhaps just for the lifetime of the Python
call), and allocate the GIL.

Regards,
Martin




More information about the Python-list mailing list