# Multiple threads, each with a self-contained VTK pipeline

**URL:** https://discourse.vtk.org/t/multiple-threads-each-with-a-self-contained-vtk-pipeline/4360
**Category:** Support
**Created:** [October 6, 2020, 11:29am UTC](https://discourse.vtk.org/t/multiple-threads-each-with-a-self-contained-vtk-pipeline/4360 "2020-10-06T11:29:57Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![harold.absalom](https://discourse.vtk.org/user_avatar/discourse.vtk.org/harold.absalom/32/1955_2.png) [@harold.absalom](https://discourse.vtk.org/u/harold.absalom)
#### Post date: [October 6, 2020, 11:29am UTC](https://discourse.vtk.org/t/multiple-threads-each-with-a-self-contained-vtk-pipeline/4360/1 "2020-10-06T11:29:57Z")

</div>

I am trying to write a program where several threads are running, each with their own self-contained `vtkRenderWindow`, `vtkRenderer`, pipeline, etc. If I don’t mix any VTK objects between threads, is this possible and/or safe?

[VTK/FAQ - KitwarePublic](https://vtk.org/Wiki/VTK/FAQ#Is_VTK_thread-safe_.3F) seems to indicate this is not.

> Also, note that most of the OpenGL libraries are not thread-safe. Therefore, if you are rendering to multiple render windows from different threads, you are likely to get in trouble, even if you have mutex locks around the render calls.

Is this still accurate? If so, in which way could I achieve the closest approximation of this?

---

<div class="post-metadata">

### Author: ![harold.absalom](https://discourse.vtk.org/user_avatar/discourse.vtk.org/harold.absalom/32/1955_2.png) [@harold.absalom](https://discourse.vtk.org/u/harold.absalom)
#### Post date: [October 12, 2020, 11:22pm UTC](https://discourse.vtk.org/t/multiple-threads-each-with-a-self-contained-vtk-pipeline/4360/2 "2020-10-12T23:22:19Z")

</div>

I’ve gone ahead with trying this out, and the information appears to be out of date. Everything works so far, except for the resizing/repositioning of multiple windows, simultaneously (on Windows, at least). I’ve opened a patch to fix that, which will hopefully be merged soon: [https://gitlab.kitware.com/vtk/vtk/-/merge\_requests/7313](https://gitlab.kitware.com/vtk/vtk/-/merge_requests/7313)
