Re: C API design flaw (was: Re: Multiple independent Python interpreters in a C/C++ program?)

2008-04-13 Thread Rhamphoryncus
On Apr 12, 2:02 pm, sturlamolden [EMAIL PROTECTED] wrote: On Apr 12, 7:05 pm, sturlamolden [EMAIL PROTECTED] wrote: In theory, a GIL private to each (sub)interpreter would make Python more scalable. The current GIL behaves like the BKL in earlier Linux kernels. However, some third-party

Re: Multiple independent Python interpreters in a C/C++ program?

2008-04-12 Thread Christian Heimes
Diez B. Roggisch schrieb: AFAIK there was a thread a few month ago that stated that this is actually possible - but mostly 3rd-party-c-extension aren't capable of supporting that. Martin von Loewis had a word in that, maybe googling with that in mind reveals the discussion. And of course

Re: Multiple independent Python interpreters in a C/C++ program?

2008-04-12 Thread Rhamphoryncus
On Apr 11, 10:24 am, [EMAIL PROTECTED] wrote: This question was posed to me today. Given a C/C++ program we can clearly embed a Python interpreter in it. Is it possible to fire up multiple interpreters in multiple threads? For example: C++ main thread 1

Re: Multiple independent Python interpreters in a C/C++ program?

2008-04-12 Thread sturlamolden
On Apr 11, 6:24 pm, [EMAIL PROTECTED] wrote: Do I wind up with two completely independent interpreters, one per thread? I'm thinking this doesn't work (there are bits which aren't thread-safe and are only protected by the GIL), but wanted to double-check to be sure. You can create a new

Re: Multiple independent Python interpreters in a C/C++ program?

2008-04-12 Thread sturlamolden
On Apr 11, 6:24 pm, [EMAIL PROTECTED] wrote: Do I wind up with two completely independent interpreters, one per thread? I'm thinking this doesn't work (there are bits which aren't thread-safe and are only protected by the GIL), but wanted to double-check to be sure. You can create a new

C API design flaw (was: Re: Multiple independent Python interpreters in a C/C++ program?)

2008-04-12 Thread sturlamolden
On Apr 12, 7:05 pm, sturlamolden [EMAIL PROTECTED] wrote: In theory, a GIL private to each (sub)interpreter would make Python more scalable. The current GIL behaves like the BKL in earlier Linux kernels. However, some third-party software, notably Apache's mod_python, is claimed to depend on

Re: Multiple independent Python interpreters in a C/C++ program?

2008-04-12 Thread Graham Dumpleton
On Apr 13, 3:05 am, sturlamolden [EMAIL PROTECTED] wrote: On Apr 11, 6:24 pm, [EMAIL PROTECTED] wrote: Do I wind up with two completely independent interpreters, one per thread? I'm thinking this doesn't work (there are bits which aren't thread-safe and are only protected by the GIL), but

Multiple independent Python interpreters in a C/C++ program?

2008-04-11 Thread skip
This question was posed to me today. Given a C/C++ program we can clearly embed a Python interpreter in it. Is it possible to fire up multiple interpreters in multiple threads? For example: C++ main thread 1 Py_Initialize() thread 2 Py_Initialize()

Re: Multiple independent Python interpreters in a C/C++ program?

2008-04-11 Thread Diez B. Roggisch
[EMAIL PROTECTED] schrieb: This question was posed to me today. Given a C/C++ program we can clearly embed a Python interpreter in it. Is it possible to fire up multiple interpreters in multiple threads? For example: C++ main thread 1 Py_Initialize()

Re: Multiple independent Python interpreters in a C/C++ program?

2008-04-11 Thread Matimus
On Apr 11, 9:24 am, [EMAIL PROTECTED] wrote: This question was posed to me today. Given a C/C++ program we can clearly embed a Python interpreter in it. Is it possible to fire up multiple interpreters in multiple threads? For example: C++ main thread 1

Re: Multiple independent Python interpreters in a C/C++ program?

2008-04-11 Thread Matthieu Brucher
2008/4/11, [EMAIL PROTECTED] [EMAIL PROTECTED]: This question was posed to me today. Given a C/C++ program we can clearly embed a Python interpreter in it. Is it possible to fire up multiple interpreters in multiple threads? For example: C++ main thread 1

Re: Multiple independent Python interpreters in a C/C++ program?

2008-04-11 Thread Skip Montanaro
Hi,You will only have one the different static Python variables, so this is not possible. Thanks, that's pretty much what I expected... Skip -- http://mail.python.org/mailman/listinfo/python-list