[Python-ideas] A concurrency survey of sorts

Weeble clockworksaint at gmail.com
Fri Nov 4 19:42:25 CET 2011


> 2011/11/4 Weeble <clockworksaint at gmail.com>
>> Is this a serious proposal? Without threads, is there any reasonable
>> cross-platform way to communicate interactively with multiple subprocesses
>> over pipes? Windows doesn't have select. I don't *like* using threads, but
>> as far as I can tell they're the only available way to do this.

On Fri, Nov 4, 2011 at 6:13 PM, Amaury Forgeot d'Arc <amauryfa at gmail.com> wrote:
> Windows does have a select(), even if this only works for sockets,
> (you can use WaitForSingleObject for any win32 handle)
> and the Twisted reactor has a spawnProcess() function that works without any
> additional thread.

select: Yes.

WaitForSingleObject: Really? The documentation seems to say only on
events, mutexes, semaphores, processes and threads. No mention of
pipes or files. http://msdn.microsoft.com/en-us/library/bb202783.aspx
Also, presumably it would be WaitForMultipleObjects? Regardless, I'm
sure there's some way to do this. I just don't think it's obvious or
easy enough to be considered a reasonable alternative to using
threads.

Twisted: That actually looks quite nice, but pulling in Twisted isn't
always going to be a reasonable option.

I just want to be sure - the idea of removing the threading module
sounds ludicrous. It's not getting serious consideration, is it?



More information about the Python-ideas mailing list