McMillan Installer and threads

Robin Becker robin at jessikat.fsnet.co.uk
Sat Oct 12 10:50:29 EDT 2002


In article <Xns92A55CB6181CEgmcmhypernetcom at 199.171.54.214>, Gordon
McMillan <gmcm at hypernet.com> writes
>Robin Becker wrote:
>
>> Gordon McMillan's new installer stuff starts locking its internal state
>> when it sees that the thread module is imported.
>> 
>> Does the use of thread.acquire/release imply we are getting the overhead
>> of multi-threading or does start_new_thread actually have to be called?
>
>It's just the presence of the thread module.
>
>Conceivably, C code could create a situation where threads
>are active without start_new_thread ever being called.
>Perhaps even without the thread module being imported, but
>there doesn't seem to be a way to tell from pure Python 
>whether threads have been initialized at the C level.
        PyEval_InitThreads()

it seems that only start_new_thread calls PyEval_InitThreads() so
presumably just using locks doesn't cost much.
-- 
Robin Becker



More information about the Python-list mailing list