Q: vtkMultiThreader. Threads. How to use? Example?
Lisa Sobierajski Avila
lisa.avila at kitware.com
Thu Jul 1 09:49:25 EDT 1999
Hi Audrius,
You should not have a problem having several vtkRenderWindowInteractors in
the same thread - so you shouldn't need to worry about thread safeness for
that. As for your program going off and doing other stuff in another thread
it depends on what that other stuff is. I believe that on most platforms
you can't use OpenGL from more than one thread at a time (definitely not on
the same context). If you are not doing OpenGL and not working on the same
objects that the interactors are displaying (or the entire pipeline up to
that point) then everything is fine. If you are altering the pipelines or
any of the objects in the pipelines from the other thread, then it will be
difficult or maybe even impossible without adding mutex calls to the code
to guarantee that two threads don't collide.
Lisa
At 02:25 PM 6/30/99 -0700, Audrius Stundzia wrote:
>Hi Lisa,
>
>Thanks for your prompt reply. Much appreciated.
>I'll have a look at the examples.
>
>Basically, I want to spin off several vtkRenderWindowInteractor objects as
>seperate threads so that I can interact with the windows while my program
>goes off and does other stuff. Doable?
>
>Best regards,
>
>Audrius
>
>On Wed, 30 Jun 1999 15:23:03 -0400, Lisa Sobierajski Avila wrote:
>
>> Hello Audrius,
>>
>> Work is being done to make the graphics pipeline as thread safe as
>possible
>> - this work is still in progress. You still (and probably always will)
>have
>> to be fairly careful about which data access methods you use within
>> multi-threaded portions of vtk since we do not want to take the
>performance
>> hit of mutexing all data access.
>>
>> A fairly simple example of how to use the vtkMultiThreader can be found
>in
>> vtkFiniteDifferenceGradientEstimator - the structured points data set is
>> divided among the available processors. The threader is also used in the
>> image filter superclass to thread the imaging pipeline, and in the ray
>> caster to thread the creation of ray casted images.
>>
>> Lisa Avila
>> lisa.avila at kitware.com
>>
>>
>>
>> At 07:04 AM 6/30/99 -0700, Audrius Stundzia wrote:
>> >Dear vtker's
>> >
>> >Looking at the vtk changes list, a great deal of work has recently gone
>> >into making the graphics pipeline multi-thead safe. Unfortunately, I
>> >haven't been able to find any examples of how to use threads in a
>> >vtk context or how to use vtkMultiTreader.
>> >
>> >As I'm on a Solaris, I'm using pthreads.
>> >
>> >Any help, especially example code, would be most appreciated.
>> >
>> >Regards,
>> >
>> >Audrius
>> >
>> >
>> >
>> >
>> >_______________________________________________________
>> >Get your free, private email at http://mail.excite.com/
>> >
>> >
>>
>>---------------------------------------------------------------------------
>--
>> >This is the private VTK discussion list. Please keep messages on-topic.
>> >Check the FAQ at: <http://www.automatrix.com/cgi-bin/vtkfaq>
>> >To UNSUBSCRIBE, send message body containing "unsubscribe vtkusers" to
>> ><majordomo at gsao.med.ge.com>. For help, send message body containing
>> >"info vtkusers" to the same address. Live long and prosper.
>>
>>---------------------------------------------------------------------------
>--
>> >
>>
>>
>>
>>
>----------------------------------------------------------------------------
>-
>> This is the private VTK discussion list. Please keep messages on-topic.
>> Check the FAQ at: <http://www.automatrix.com/cgi-bin/vtkfaq>
>> To UNSUBSCRIBE, send message body containing "unsubscribe vtkusers" to
>> <majordomo at gsao.med.ge.com>. For help, send message body containing
>> "info vtkusers" to the same address. Live long and prosper.
>>
>----------------------------------------------------------------------------
>-
>>
>
>
>
>
>
>_______________________________________________________
>Get your free, private email at http://mail.excite.com/
>
-----------------------------------------------------------------------------
This is the private VTK discussion list. Please keep messages on-topic.
Check the FAQ at: <http://www.automatrix.com/cgi-bin/vtkfaq>
To UNSUBSCRIBE, send message body containing "unsubscribe vtkusers" to
<majordomo at gsao.med.ge.com>. For help, send message body containing
"info vtkusers" to the same address. Live long and prosper.
-----------------------------------------------------------------------------
More information about the vtkusers
mailing list