[vtk-developers] suggestion for vtkMultiThreader.cxx
Lisa Sobierajski Avila
lisa.avila at kitware.com
Mon Jun 4 22:48:37 EDT 2001
Hello Simon,
There are this->NumberOfThreads threads running - this->NumberOfThreads-1
are created, and the parent thread runs too.
Lisa
At 10:43 PM 6/4/2001, Simon Warfield wrote:
>vtkMultiThreader.cxx in some places uses a strategy of starting
>this->NumberOfThreads-1 additional threads to run work in separate threads
>and runs a pthread_join to wait for these jobs to complete.
>
> The thread running the pthread_join is suspended until the thread it is
>waiting for finishes. If there are this->NumberOfThreads CPUs available
>for work then running only this->NumberOfThreads-1 jobs wastes wallclock time.
> It would be better to run this->NumberOfThreads of jobs.
>
>
>vtkMultiThreader.cxx lines 322-341:
> // Using POSIX threads
> //
> // We want to use pthread_create to start this->NumberOfThreads-1
> additional
> // threads which will be used to call this->SingleMethod(). The
> // parent thread will also call this routine. When it is done,
> // it will wait for all the children to finish.
> //
> // First, start up the this->NumberOfThreads-1 processes. Keep track
> // of their process ids for use later in the pthread_join call
>
>--
>Simon Warfield, Ph.D. warfield at bwh.harvard.edu Phone:617-732-7090
>http://www.spl.harvard.edu/~warfield FAX: 617-582-6033
>Thorn 329, Brigham and Women's Hospital, Harvard Medical School
>Department of Radiology, 75 Francis St, Boston, MA, 02115
>
>_______________________________________________
>vtk-developers mailing list
>vtk-developers at public.kitware.com
>http://public.kitware.com/mailman/listinfo/vtk-developers
More information about the vtk-developers
mailing list