Is the standard output thread-safe?

Fernando Rodríguez frr at easyjob.net
Thu Mar 9 17:37:46 CET 2006


Hello Fredrik,

> Fernando Rodríguez wrote:
> 
>> Is the standard output thread-safe? Can I use print from several
>> threads without having to use a mutex?
>> 
> if you use sys.stdout.write on the standard sys.stdout stream, each
> write operation is "atomic" (thanks to the GIL).

GIL?





More information about the Python-list mailing list