Yield inside try...finally

Michael Sparks michaels at rd.bbc.co.uk
Fri Jun 6 05:11:01 EDT 2003


andrew cooke <andrew at acooke.org> wrote :
...
> in that case, maybe you should use a separate thread?!

The reason for not using threads is the usual one in systems aiming for
high network server load. If you have a big enough load on the system
with a threads based approach you end up with a measurably large overhead
in context switching between threads or processes. On some OSs this
isn't _too_ bad, on some it's horrendous. Also by using threads you
it's harder to perform adaptive scheduling based on (say) throughput
to/from clients. With an asynchronous approach you have at least that
potential in a much easier form - simply because you're controlling the
scheduling, not the OS.

If it was just a client side piece of code I'd probably be using the standard
Socket stuff supplied with python + threads where necessary.

Thanks for the comments though :)

Regards,


Michael.
--
Michael.Sparks at rd.bbc.co.uk
British Broadcasting Corporation, Research and Development
Kingswood Warren, Surrey KT20 6NP

This message (and any attachments) may contain personal views
which are not the views of the BBC unless specifically stated.




More information about the Python-list mailing list