Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.glorb.com!news.linkpendium.com!news.linkpendium.com!panix!not-for-mail From: Grant Edwards Newsgroups: comp.lang.python Subject: Re: GIL detector Date: Mon, 18 Aug 2014 15:05:40 +0000 (UTC) Organization: PANIX Public Access Internet and UNIX, NYC Lines: 33 Message-ID: References: <53f0ba6c$0$29982$c3e8da3$5496439d@news.astraweb.com> NNTP-Posting-Host: dsl.comtrol.com X-Trace: reader1.panix.com 1408374340 6662 64.122.56.22 (18 Aug 2014 15:05:40 GMT) X-Complaints-To: abuse@panix.com NNTP-Posting-Date: Mon, 18 Aug 2014 15:05:40 +0000 (UTC) User-Agent: slrn/1.0.1 (Linux) Xref: csiph.com comp.lang.python:76482 On 2014-08-17, Stefan Behnel wrote: > Steven D'Aprano schrieb am 17.08.2014 um 16:21: >> I wonder whether Ruby programmers are as obsessive about >> Ruby's GIL? > > I actually wonder more whether Python programmers are really all that > obsessive about CPython's GIL. [...] > Personally, I like the GIL. It helps me keep my code simpler and more > predictable. I don't have to care about threading issues all the time and > can otherwise freely choose the right model of parallelism that suits my > current use case when the need arises (and threads are rarely the right > model). I'm sure that's not just me. Those are pretty much my feelings exactly. I've been writing Python apps for 15 years. They're mostly smallish utlities, network and serial comm stuff, a few WxWidgets and GTK apps, some IMAP, SMTP and HTTP stuff. Many are multi-threaded, and some of the mesh data analysis and visualization ones ran for a few 10's of minutes. I don't remember a single instance where the GIL was even as much as annoying. The GIL means that multi-threaded apps most "just work" and you don't have to sprinkle mutexes all over your code the way you do in C using pthreads. You do sometimes need to use mutexs in Python, only at a higher layer -- there's a whole lower layer of mutexes that you don't need because of the GIL. -- Grant Edwards grant.b.edwards Yow! On the road, ZIPPY at is a pinhead without a gmail.com purpose, but never without a POINT.