[Insight-users] ThreadedGenerateData()

Vikash Gupta vikash.gupta at inria.fr
Thu Mar 21 16:47:31 EDT 2013


Hi Matt and Willi, 
Thanks for your insights in the Insight ToolKit :) . Yes I agree that the the number of threads will be divided on the number of cpus, my only worry was what happens in multithreading when I am assigning one particular job to one particular CPU, and from your answeres i feel that on the second level of multi-threading I should be little bit careful, as in if the CPU has 4 cores i shouldnt assign it 8 using SetNumberOfThreads() and the computing will be restricted to the CPU itself.. 

Thanks 
Vikash 

----- Original Message -----

> From: "Willi Huber" <surfersparadise85-itk at yahoo.com>
> To: "insight-users at itk org" <insight-users at itk.org>, "vikash gupta"
> <vikash.gupta at inria.fr>
> Sent: Friday, March 22, 2013 2:07:18 AM
> Subject: AW: [Insight-users] ThreadedGenerateData()

> Hello Vikash,
> this might not be correct since I have no deep insight into ITK an
> wether or not they have their own threading library but usually your
> OS, i.e. Windows or Linux, takes care of the distribution of
> threads.
> I don't know of any threading library that fixes threads to a certain
> Core or CPU since that is the idea behind threads: "Loadbalancing".
> Therefore it (OS or some hardware) attaches threads to a Core which
> is currently out of work.
> Cheers,
> Willi

> From: Vikash Gupta <vikash.gupta at inria.fr>;
> To: itk <insight-users at itk.org>;
> Subject: [Insight-users] ThreadedGenerateData()
> Sent: Thu, Mar 21, 2013 8:02:22 PM

> 
> Dear Itk-Users,
> This might be a naive question but I am pondering over it for some
> time. When the ThreadedGenerateData() function is called in an itk
> filter, the threads refer to the number of CPUs on a computer or the
> number of cores on each CPU.

> For example, i have 8 cpus on my laptop with 4 cores on each, so if I
> call SetNumberOfThreads(4), these 4 cores will belong to the same
> CPU ?

> On the next lever, if I divide the work on each cpu and then also do
> multithreading in each CPU, will the number of threads correspond to
> the number of cores on each CPU ?
> Thanks a lot for any insight..

> Vikash
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20130321/7ec9a50d/attachment.htm>


More information about the Insight-users mailing list