[vtkusers] using vtkMultiThreader

reyes mauricio mreyesa at hotmail.com
Mon Feb 9 07:10:48 EST 2004


Hi vtkUsers,

I try to use vtkMultiThreader in a simple example like printing the data 
passed to the thread, this is my code:

//some test value
int a=23;
int *pa;
pa=&a;

vtkMultiThreader *threader=vtkMultiThreader::New();
threader->SetNumberOfThreads(1);
threader->SetSingleMethod(myfunction,(int*)pa);

threader->SingleMethodExecute();
...
..

where "myfunction" is:

VTK_THREAD_RETURN_TYPE myfunction(void *arg)
{
   cout<<*((int*)arg)<<std::endl;
   return VTK_THREAD_RETURN_VALUE;
}

After executing this code, I get a zero value from the Thread, what could be 
happening?
The compilation and linking are ok, so I presume that I don't have to add 
any extra configuration to cmake, or am I wrong?

  Best Regards,
    Mauricio

_________________________________________________________________
Charla con tus amigos en línea mediante MSN Messenger: 
http://messenger.latam.msn.com/




More information about the vtkusers mailing list