[vtkusers] VTK 7.0.0 + Python: GIL released?

Mathieu Westphal mathieu.westphal at kitware.com
Thu Sep 8 07:51:18 EDT 2016


Hi

All python calls are protected by gil if the VTK_PYTHON_FULL_THREADSAFE
option is on.
The mechanism take place in vtkPython.h, where the vtkPythonScopeGilEnsurer
is configured by the cmake option.
the vtkPythonScopeGilEnsurer is then ( suposed to be ) used before every
pthon call.

Regards,

Mathieu Westphal

On Thu, Sep 8, 2016 at 1:23 PM, Paul Melis <paul.melis at surfsara.nl> wrote:

> Hi all,
>
> What's the status of threading in VTK 7.0.0 under Python w.r.t the GIL,
> specifically for classes derived from vtkAlgorithm?
> I'm attempting to offload a computation (basically
> vtkStreamTracer.Update())
> to a Python threading.Thread, but strongly get the impression that
> the GIL is not released by Update().
>
> The release notes (https://blog.kitware.com/vtk-7-0-0/) seem to suggest
> there was some recent development in this area:
>
> * multi-threaded Python codes facilitated by VTK's new and optional
>   protocol for using the Global Interpreter Lock
>
> But clicking the link appears to indicate this is for VTK used inside
> Paraview only. I see the mentioned cmake variable
> VTK_PYTHON_FULL_THREADSAFE
> referenced by files under Utilities/Python, but the cmake files themselves
> don't contain a reference, nor something like an option. Would hacking
> the define in somewhere cause Update() to be protected by the GIL?
> Commit https://github.com/Kitware/VTK/commit/
> 8eb50dd23fd762d42fe1a6785bbaa704f2ed76c3
> lists some classes and their possible protection by
> vtkPythonScopeGilEnsurer,
> but what specifically is covered isn't entirely clear to me.
>
> Thanks,
> Paul
>
> --
>
> Paul Melis
> | Visualization group leader & developer | SURFsara |
> | Science Park 140 | 1098 XG Amsterdam |
> | T 020 800 1312 | paul.melis at surfsara.nl | www.surfsara.nl |
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/
> opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Search the list archives at: http://markmail.org/search/?q=vtkusers
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/vtkusers
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20160908/0ed64b58/attachment-0001.html>


More information about the vtkusers mailing list