Problem with Threads

Dave Angel d at davea.name
Wed Dec 19 19:23:37 CET 2012


On 12/19/2012 12:11 PM, Kwnstantinos Euaggelidis wrote:
> I have this code for Prime Numbers and i want to do it with Threads.. Any idea.??

Why do you want to do it with threads?  Is it to speed up the
processing? (Guessing that partly because of your printing "elapsed
time."  Chances are running this code in multiple threads will be
substantially slower.

If you want speed, you could speed up the algorithm by a few orders of
magnitude.  Ask for suggestions.

On the other hand, you might be interested in deciding/discussing the
tradeoffs of implementing an arbitrary algorithm serially or in
parallel, using multiple threads, and/or multiple processes, and/or
multiple networked computers, and/or different possible languages.

So, if you give us some ideas about your goals, I'm sure many people
have ideas to share.



-- 

DaveA




More information about the Python-list mailing list