[Python-Dev] "Fixing" the new GIL

"Martin v. Löwis" martin at v.loewis.de
Sun Mar 14 19:32:52 CET 2010


> Speaking for myself, I have an app with a daemon mode which I expect
> will sometimes behave as described; it answers requests and thus has I/O
> bound threads waiting for requests and dispatching replies, and threads
> doing data handling, which make constant use of the zlib library.

This is then already different from the scenario described. Every call
into zlib will release the GIL, for the period of the zlib computation,
allowing other threads to run.

> On the
> client side the same app is often throughput bound by a data examination
> process that is compute bound; I can easily see it having compute bound
> threads and I/O bound threads talking to daemon instances.

I can't see that. I would expect that typically (and specifically
including your application), the compute bound threads will synchronize
with the IO bound ones, asking for more requests to perform.

That's the whole point of using the "bound" adjective (?): execution
time is *bound* by the computation time. It can't get faster than what
the computation can process.

Regards,
Martni


More information about the Python-Dev mailing list