[issue17140] Provide a more obvious public ThreadPool API

Nick Coghlan report at bugs.python.org
Tue May 21 15:43:28 CEST 2013


Nick Coghlan added the comment:

No, I mean implementing communicating sequential processes with independent state machines passing messages to each other. There aren't necessarily any fixed request/reply pairs. Each actor has a "mailbox", which is a queue that you dump its messages into. If you want a reply, you'll include some kind of addressing info to get the answer back rather than receiving it back on the channel you used to send the message.

For threads, the addressing info can just be a queue.Queue reference for your own mailbox, for multiple processes it can either be multiprocessing queue, or any other form of IPC.

It's a very different architecture from that assumed by futures, so you need to drop down to the pool layer rather than using the executor model.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue17140>
_______________________________________


More information about the Python-bugs-list mailing list