Tom Panzarella on 8 Dec 2010 09:01:31 -0800 |
On Dec 7, 2010, at 7:35 PM, paul santa clara wrote: > > [1] - It should be noted that Python threads are _real_ OS-level threads they are not "green threads." However, CPython only allows a single thread to be executing within the interpreter at once ... this is enforced by the GIL. For example, using the threading module in Jython will take advantage of the underlying JVM threading ... which may or may not be truly concurrent. Likewise using threading in IronPython will use the underlying CLR's threading capabilities ... which may or may not be truly concurrent. > > Very valid points, but having used both jruby and ironruby which feature similar facilities, there are, in my experience, usually compatibility surprises going down this path. Ruby mutex's on the CLR, for instance, seemed to follow their own rules. Understood. In full disclosure, I have no real experience with IronPython or Jython. I just really wanted to point out that the GIL is an implementation detail of the CPython VM and not a Python language restriction. From a pragmatic perspective, unfortunately the GIL is also present in the CPython implementation of Python 3. So, yeah, Python threads are hobbled. > The main purpose of my question wasn't what to see what _can be_ done but rather to get a feel for the design decisions the twisted/tornado dev's had to face when building an event driven framework for the python masses. Now that you bring it up though, I am curious. Has anyone tried running twisted/tornado on the jvm or clr? Was it worth it? Understood. Unfortunately, I have nothing to offer here. -Tom.
|
|