Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

Is Boost.Python thread-aware/compatible with multiple interpreters?

0
10 Posted

Is Boost.Python thread-aware/compatible with multiple interpreters?

0

Niall Douglas provides these notes: The quick answer to this is: no. The longer answer is that it can be patched to be so, but it’s complex. You will need to add custom lock/unlock wrapping of every time your code enters Boost.Python (particularly every virtual function override) plus heavily modify boost/python/detail/invoke.hpp with custom unlock/lock wrapping of every time Boost.Python enters your code. You must furthermore take care to not unlock/lock when Boost.Python is invoking iterator changes via invoke.hpp. There is a patched invoke.hpp posted on the C++-SIG mailing list archives and you can find a real implementation of all the machinery necessary to fully implement this in the TnFOX project at this SourceForge project location.

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123