david.bri...@ubs.com wrote: > I'm looking for how to do blocking calls. If I do a blocking call into a > dll and don't release the GIL the whole of python is blocked!!! > > It says in the C-API whenever you call into a C-DLL with a blocking call > you need to release the GIL i.e. the Py_BEGIN_ALLOW_THREADS macro, and > when the call returns you need to relock the GIL i.e. > Py_END_ALLOW_THREADS. > > So want to know how to release and acquire the GIL from pure python > (i.e. via ctypes or win32).
That's impossible. The whole point of releasing the GIL is to say "I hereby promise I won't be interpreting any Python code until I reacquire the lock". If you could do that from Python code itself, you would create a singularity that will suck in the solar system. -- Tim Roberts, t...@probo.com Providenza & Boekelheide, Inc. _______________________________________________ python-win32 mailing list python-win32@python.org http://mail.python.org/mailman/listinfo/python-win32