Boost logo

Boost :

From: Ullrich Koethe (u.koethe_at_[hidden])
Date: 2001-06-25 16:11:14


dustin_at_[hidden] wrote:
>
> Please excuse my relative ignorance. My question is: I've written a
> Python Extension module in C++ using the Boost Python library. If I
> understand correctly, the thread in which my extension module
> executes will maintain a lock on the Python interpreter while
> executing within the extension module, preventing other python
> threads from executing. Can I get around this by releasing the
> interpreter lock? Any assistance would be greatly appreciated.

It should be safe to release the interpreter lock while C++ code is
executing, provided that C++ doesn't:

- call, directly or indirectly, any functions from the Python C API
- use any C++ objects accessible by other Python threads (if not
otherwise guarded)

while this thread doesn't have the lock.

Ulli

-- 
 ________________________________________________________________
|                                                                |
| Ullrich Koethe  Universität Hamburg / University of Hamburg    |
|                 FB Informatik / Dept. of Computer Science      |
|                 AB Kognitive Systeme / Cognitive Systems Group |
|                                                                |
| Phone: +49 (0)40 42883-2573                Vogt-Koelln-Str. 30 |
| Fax:   +49 (0)40 42883-2572                D - 22527 Hamburg   |
| Email: u.koethe_at_[hidden]               Germany             |
|        koethe_at_[hidden]                        |
| WWW:   http://kogs-www.informatik.uni-hamburg.de/~koethe/      |
|________________________________________________________________|

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk