[BangPypers] Ideas for Python concurrency...

Sidu Ponnappa lorddaemon at gmail.com
Tue Feb 8 13:17:13 CET 2011


> This might sound crazy..and dont know if its even possible, but...

You aren't and it is. If the underlying interpreter is encapsulated in the
right way[1], it is certainly possible. This is exactly how multiple
interpreters run in a single JVM instance[2] in JRuby (though the reason
this feature exists isn't parallelisation in an app context - JRuby dosen't
have a GIL). Perhaps the interpreter could be refactored to support this,
though I dare say it might be as complex an undertaking as simply removing
the GIL and solving the problem at the root.

Cheers,
Sidu.
http://c42.in

[1]
https://github.com/jruby/jruby/blob/master/lib/ruby/site_ruby/shared/jruby/vm.rb
[2] https://github.com/jruby/jruby/blob/master/samples/mvm.rb

On Tue, Feb 8, 2011 at 1:54 PM, Vishal <vsapre80 at gmail.com> wrote:

> Hello,
>
> This might sound crazy..and dont know if its even possible, but...
>
> Is it possible that the Python process, creates copies of the interpreter
> for each thread that is launched, and some how the thread is bound to its
> own interpreter ?
>
> This will increase the python process size...for sure, however data sharing
> will remain just like it is in threads.
>
> and it "may" also allow the two threads to run in parallel, assuming the
> processors of today can send independent instructions from the same process
> to multiple cores?
>
> Comments, suggestions, brush offs  are welcome :))
>
> Thanks and best regards,
> Vishal Sapre
> _______________________________________________
> BangPypers mailing list
> BangPypers at python.org
> http://mail.python.org/mailman/listinfo/bangpypers
>


More information about the BangPypers mailing list