I am trying to start multiple instances using a for statement but this is not working. Has anyone tried affinity module?<br><br>Tax<br><br><div class="gmail_quote">2011/5/17 Emile van Sebille <span dir="ltr">&lt;<a href="mailto:emile@fenx.com">emile@fenx.com</a>&gt;</span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">On 5/17/2011 7:29 AM tax botsis said...<div class="im"><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Part of my code includes the following script, which both shows a<br>
progress bar (for as long as &#39;categorize_reports()&#39; is executed) and<br>
prints the fileid and the output of the &#39;document&#39; function; the latter<br>
is the one increasing the calculation time (please see my comment). Any<br>
ideas on how to use all the cores of my CPU here?<br>
</blockquote>
<br></div>
A python instance lives it life on a single processor.  Accessing multiple cores requires you start multiple python instances.  You&#39;d need to restructure to provide some form of cooperative independent processing.  Pyro, stackless, and twisted come to mind.  It looks like<br>

the info at <a href="http://wiki.python.org/moin/ParallelProcessing" target="_blank">http://wiki.python.org/moin/ParallelProcessing</a> is more up to date than my memory...<br>
<br>
Emile<br>
<br>
<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">
<br>
...<br>
def categorize_reports():<br>
     if __name__ == &#39;__main__&#39;:<br>
         root2 = Tkinter.Tk(className=&#39; Processing Progress&#39;)<br>
         m = Meter(root2, relief=&#39;ridge&#39;, bd=3)<br>
         m.pack(fill=&#39;x&#39;)<br>
         i=0.0<br>
         for fileid in fileids():<br>
             m.set(i, &#39;Processing will take a few minutes...&#39;)<br>
             i=i+1.000/len(fileids())<br>
             m.after(1000, lambda: _demo(m, i))<br>
             print str(fileid), document(fileid) #this slows down the<br>
process<br>
         root2.withdraw()<br>
...<br>
<br>
Thanks<br>
Tax<br>
<br>
<br>
<br></div>
_______________________________________________<br>
Tutor maillist  -  <a href="mailto:Tutor@python.org" target="_blank">Tutor@python.org</a><br>
To unsubscribe or change subscription options:<br>
<a href="http://mail.python.org/mailman/listinfo/tutor" target="_blank">http://mail.python.org/mailman/listinfo/tutor</a><br>
</blockquote>
<br>
<br>
_______________________________________________<br>
Tutor maillist  -  <a href="mailto:Tutor@python.org" target="_blank">Tutor@python.org</a><br>
To unsubscribe or change subscription options:<br>
<a href="http://mail.python.org/mailman/listinfo/tutor" target="_blank">http://mail.python.org/mailman/listinfo/tutor</a><br>
</blockquote></div><br>