Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail From: Paul Rubin Newsgroups: comp.lang.python Subject: Re: Future of Pypy? Date: Sun, 22 Feb 2015 22:13:49 -0800 Organization: A noiseless patient Spider Lines: 14 Message-ID: <87h9udb1eq.fsf@jester.gateway.pace.com> References: <87fv9xdb22.fsf@jester.gateway.pace.com> <54ea7ff4$0$12983$c3e8da3$5496439d@news.astraweb.com> <87zj85bcyu.fsf@jester.gateway.pace.com> <87lhjpb89i.fsf@jester.gateway.pace.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: mx02.eternal-september.org; posting-host="c694756f1077760bb5296aae16c74092"; logging-data="11455"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19l0LcYLP2W50liexuWWzx3" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) Cancel-Lock: sha1:DaPtKAJxSqOQK9iKkpfXLiZkwNE= sha1:mFTqHcyHN+YBVvdX0R2Wfriz6Eg= Xref: csiph.com comp.lang.python:86193 Ryan Stuart writes: > I think that is a pretty accurate summary. In fact, the article even > says that. So, just to iterate its point, if you are using > non-blocking Queues to communicate to these threads, then you just > have a communicating event loop. Given that Queues work perfectly with > with processes as well, what is the point of using a thread? What do you mean about Queues working with processes? I meant Queue.Queue. There is multiprocessing.Queue but that's much less capable, and it uses cumbersome IPC like pipes or sockets instead of a lighter weight lock. Threads can also share read-only data and you can pass arbitrary objects (such as code callables that you want the other thread to execute--this is quite useful) through Queue.Queue. I don't think you can do that with the multiprocessing module.