Multi-Threading and KeyboardInterrupt

Mike Kazantsev mk.fraggod at gmail.com
Mon Jun 15 11:53:35 EDT 2009


On Mon, 15 Jun 2009 05:37:14 -0700 (PDT)
OdarR <Olivier.Darge at gmail.com> wrote:

> On 13 juin, 07:25, Mike Kazantsev <mk.frag... at gmail.com> wrote:
> > There was quite interesting explaination of what happens when you send
> > ^C with threads, posted on concurrency-sig list recently:
> >
> >  http://blip.tv/file/2232410
> >  http://www.dabeaz.com/python/GIL.pdf
> >
> > Can be quite shocking, but my experience w/ threads only confirms that.
> 
> Hi there,
> please read this package page (in 2.6), this is very interesting.
> http://docs.python.org/library/multiprocessing.html
> 
> I tested it : it works. Multi-core cpu's are happy :-)

I'd certainly prefer using processes because they indeed work
flawlessly in that respect, but threads are way simplier and much more
integrated into the language, so I can avoid re-imlementing tons of
shared stuff, IPC and locking by using threads which bassically run in
the same context.
That might mean 90% of code for trivial but parallel task.

Alas, they don't work flawlessly in all cases, but there is still
million and one use for them.

-- 
Mike Kazantsev // fraggod.net
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 205 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/python-list/attachments/20090615/1f3d9262/attachment.sig>


More information about the Python-list mailing list