From: Anthony Geay Date: Wed, 25 Sep 2019 08:35:04 +0000 (+0200) Subject: Rationalize the GIL management of AdaoExchangeLayer class X-Git-Tag: V9_4_0~4 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=d84c7d6a94dd9b47772ae62cbec1eccf7fc55d0d;p=tools%2Fadao_interface.git Rationalize the GIL management of AdaoExchangeLayer class --- diff --git a/AdaoExchangeLayer.cxx b/AdaoExchangeLayer.cxx index a478bf0..09e396f 100644 --- a/AdaoExchangeLayer.cxx +++ b/AdaoExchangeLayer.cxx @@ -280,6 +280,7 @@ private: void AdaoExchangeLayer::loadTemplate(AdaoModel::MainModel *model) { + AutoGIL agil; const char DECORATOR_FUNC[]="def DecoratorAdao(cppFunc):\n" " def evaluator( xserie ):\n" " import numpy as np\n" diff --git a/README.txt b/README.txt index 3a07fde..a7ac090 100644 --- a/README.txt +++ b/README.txt @@ -2,4 +2,14 @@ _internal->_py_call_back : Py function intercepting multifunc call _internal->_decorator_func : Decoration func around _internal->_py_call_back to deal with returned values of _internal->_py_call_back +################# user GIL management in AdaoExchangeLayer +class AdaoExchangeLayer has been developped to be launched from any thread. + +AdaoExchangeLayer manage the GIL (using AutoGIL) in its implementation. + +Consequence the AdaoExchangeLayer instance should NOT be surrounded by GIL protection. + +############## user GIL management in AdaoModel::MainModel + +The custom MainModel overloading should be GIL protected by the user.