Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #6482
| Date | 2011-05-28 09:39 -0700 |
|---|---|
| From | John Nagle <nagle@animats.com> |
| Newsgroups | comp.lang.python |
| Subject | Re: GIL in alternative implementations |
| References | <4DE015EA.4040600@gmail.com> <mailman.2185.1306548406.9059.python-list@python.org> |
| Message-ID | <4de1252d$0$2203$742ec2ed@news.sonic.net> (permalink) |
| Organization | Sonic.Net |
On 5/27/2011 7:06 PM, Daniel Kluev wrote: >> So I'd like to know: how do these other implementations handle concurrency >> matters for their primitive types, and prevent them from getting corrupted >> in multithreaded programs (if they do) ? I'm not only thinking about python >> types, but also primitive containers and types used in .Net and Java VMs, >> which aren't atomic elements either at an assembly-level point of view. "+=" is not guaranteed to be atomic in most languages. Some C and C++ implementations have "atomic_inc", etc., which is guaranteed to execute as an atomic operation. How do most safe languages handle concurrency? For the unboxed primitive types, like numbers, the hardware handles it. For memory allocation, there's a lock. Most don't allow patching code on the fly. Concurrent garbage collection prevents deleting something if there's a pointer to it anywhere. This was all worked out for LISP and SELF decades ago. Python allows patching code while the code is executing. This implies a sizable performance penalty, and causes incredible complexity in PyPy. John Nagle
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Re: GIL in alternative implementations Daniel Kluev <dan.kluev@gmail.com> - 2011-05-28 13:06 +1100
Re: GIL in alternative implementations Marc Christiansen <usenet@solar-empire.de> - 2011-05-28 11:55 +0200
Re: GIL in alternative implementations Wolfgang Rohdewald <wolfgang@rohdewald.de> - 2011-05-28 13:16 +0200
Re: GIL in alternative implementations John Nagle <nagle@animats.com> - 2011-05-28 09:39 -0700
Re: GIL in alternative implementations Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2011-05-28 17:05 +0000
Re: GIL in alternative implementations "Gabriel Genellina" <gagsl-py2@yahoo.com.ar> - 2011-06-07 01:03 -0300
Re: GIL in alternative implementations Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2011-06-07 07:09 +0000
Re: GIL in alternative implementations Jean-Paul Calderone <calderone.jeanpaul@gmail.com> - 2011-06-07 05:07 -0700
csiph-web