[Python-Dev] HP-UX clean-up

Tim Peters tim.one at comcast.net
Fri Jan 9 13:33:51 EST 2004


[Andrew MacKeith]
> ...
> NOTE: the multithreading flags (-D_REENTRANT -mt) should only
> be applied to the files where there is actually threaded code.
> When applied to all files indiscriminately, they cause overall
> performance degradation.
> AFAIK the files with threaded code are:
> thread.c
> threadmodule.c

I'm not sure that makes sense, or maybe it's that I don't understand what
sense it makes <wink>.  For concrete examples, any number of threads may
simultaneously be executing fileobject.c's file_close() function, or
zlibmodule.c's PyZlib_decompress() function.  If the compiler doesn't
generate thread-correct code for those, they can fail in arbitrarily horrid
ways.  Every place the source code releases the GIL is a place any number of
threads may be active simultaneously.




More information about the Python-Dev mailing list