basic thread question

sturlamolden sturlamolden at yahoo.no
Mon Aug 24 10:31:57 EDT 2009


On 24 Aug, 13:21, Piet van Oostrum <p... at cs.uu.nl> wrote:

> But os.fork() is not available on Windows. And I guess refcounts et al.
> will soon destroy the sharing.

Well, there is os.fork in Cygwin and SUA (SUA is the Unix subsytem in
Windows Vista Professional). Cygwin's fork is a bit sluggish.

Multiprocessing works on Windows and Linux alike.

Apart from that, how are you going to use threads? The GIL will not be
a problem if it can be released. Mostly, the GIL is a hypothetical
problem. It is only a problem for compute-bound code written in pure
Python. But very few use Python for that. However, if you do and can
afford the 200x speed penalty from using Python (instead of C, C++,
Fortran, Cython), you can just as well accept that only one CPU is
used.


Sturla Molden














More information about the Python-list mailing list