Concurrency models (was: Timer)
Alex Martelli
aleax at aleax.it
Tue Oct 28 06:53:25 EST 2003
Alan Kennedy wrote:
...
> And the patchy support for SSL in asynch frameworks is another
> fundamental problem.
Hmmm, what's wrong with Twisted+pyOpenSSL...? Seems to work fine...
> Another point in favour of threads: On a multi-processor box, the
> thread abstraction generally "automagically" gives you free migration
> to other processors. You (generally) don't have to change a line of
> your code: the underlying [OS|VM] takes care of it.
*blink*? Uh, doesn't that depend on how you choose to have your
threads communicate with each other? The most Pythonic solution
is generally to have threads communicate via Queue instances. Can
you point me to a "cross-process Queue" class for Linux and Windows?
Not a rhetoric question -- I'd LIKE to be able to scale things up that
way, but see some problems with translating typical Queue use idioms,
particularly in a cross-platform way, to cross-process:
-- N1 client-threads posting workrequests to Q and N2 worker-threads
peeling workrequests off Q and working on them;
-- a workrequest including a reference to the Queue instance on
which the worker-thread is going to post the response/result
Alex
More information about the Python-list
mailing list