Hi,

are the thread GIL releasing functions going to be supported in pypy
with CPyExt?

To allow this usage:

PyThreadState *_save;
_save = PyEval_SaveThread();
// ...Do some blocking I/O operation, or CPU intensive operation that
does not use the python api...
PyEval_RestoreThread(_save);

Or using the macros...

Py_BEGIN_ALLOW_THREADS;
// ...Do some blocking I/O operation, or CPU intensive operation that
does not use the python api...
Py_END_ALLOW_THREADS;

Is it not possible or too hard, or is it just not implemented yet?





On Tue, Jan 4, 2011 at 5:25 PM, Duncan Grisby <[email protected]> wrote:
> Hi,
>
> I've been experimenting with using PyPy in a big application, and the
> initial results are very encouraging. One part of the application is a
> fairly complex compiler, and that goes 2.5 times faster with PyPy than
> with Python 2.6, which is a very positive result.
>
> The compiler is the one CPU-intensive bit of the system that I could
> easily isolate to test with PyPy. All the rest of it consists of a
> number of servers connected together using omniORB (which I maintain).
> omniORBpy integrates the C++ core of omniORB with Python, via the C API.
> omniORB is multi-threaded, and needs to call into Python from threads
> created in the C++ world. With CPython that's possible, although it
> takes some care to behave properly with thread states and the
> interpreter lock and so on.
>
> As far as I can see, PyPy's C API implementation doesn't support the
> thread state functions like PyGILState_Ensure and PyThreadState_Get,
> which isn't a huge surprise given how different PyPy is. Are these
> functions likely to be implemented at any point?  Alternatively, is
> there any other way for C/C++ code to call into PyPy from a thread
> created outside PyPy?
>
> If there isn't a mechanism to do it at the moment, is it possible at
> all?  How much effort would it be to create one?
>
> Thanks,
>
> Duncan.
>
> --
>  -- Duncan Grisby         --
>  -- [email protected]     --
>   -- http://www.grisby.org --
>
>
> _______________________________________________
> [email protected]
> http://codespeak.net/mailman/listinfo/pypy-dev
>
_______________________________________________
[email protected]
http://codespeak.net/mailman/listinfo/pypy-dev

Reply via email to