<html><head><style type='text/css'>p { margin: 0; }</style></head><body><div style='font-family: times new roman,new york,times,serif; font-size: 12pt; color: #000000'>Hi Matt and Willi, <br>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..<br><br>Thanks <br>Vikash <br><br><hr id="zwchr"><blockquote style="border-left:2px solid #1010FF;margin-left:5px;padding-left:5px;color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt;"><b>From: </b>"Willi Huber" &lt;surfersparadise85-itk@yahoo.com&gt;<br><b>To: </b>"insight-users@itk org" &lt;insight-users@itk.org&gt;, "vikash gupta" &lt;vikash.gupta@inria.fr&gt;<br><b>Sent: </b>Friday, March 22, 2013 2:07:18 AM<br><b>Subject: </b>AW: [Insight-users] ThreadedGenerateData()<br><br><table border="0" cellpadding="0" cellspacing="0"><tbody><tr><td style="font: inherit;" valign="top"><p>Hello Vikash,</p>
<p>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.<br>
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". <br>
Therefore it (OS or some hardware) attaches threads to a Core which is currently out of work.</p>
<p>Cheers,<br>
Willi</p>
</td></tr></tbody></table>            <div id="_origMsg_">
                <div style="font-family:arial, helvetica, sans-serif:font-size:10pt">
                    <br>
                    <div style="font-family:times new roman, new york, times, serif;font-size:12pt">
                        <font face="Tahoma" size="2">
                            <hr size="1">
                            <b>
                                <span style="font-weight:bold;">From:</span>
                            </b>
                            Vikash Gupta &lt;vikash.gupta@inria.fr&gt;;                            <br>
                            <b>
                                <span style="font-weight:bold:">To:</span>
                            </b>
                            itk &lt;insight-users@itk.org&gt;;                                                                                                     <br>
                            <b>
                                <span style="font-weight:bold:">Subject:</span>
                            </b>
                            [Insight-users] ThreadedGenerateData()                            <br>
                            <b>
                                <span style="font-weight:bold;">Sent:</span>
                            </b>
                            Thu, Mar 21, 2013 8:02:22 PM                            <br>
                            </font>
                            <br>
                            <table border="0" cellpadding="0" cellspacing="0">
                                <tbody>
                                    <tr>
                                        <td style="font:inherit;" valign="top"><div style="font-family:times new roman, new york, times, serif;font-size:12pt;color:#000000;">Dear Itk-Users, <br>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. <br><br>For example, <span style="white-space:pre;">        </span>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 ? <br><br>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 ?<br>Thanks a lot for any insight..<br><br>Vikash<br><br></div></td>
                                    </tr>
                                </tbody>
                            </table>
                    </div>
                </div>
            </div>
</blockquote><br></div></body></html>