DurumDara wrote: > 10 May 2006 04:57:17 -0700, Serge Orlov <[EMAIL PROTECTED]>: > > I thought md5 algorithm is pretty light, so you'll be I/O-bound, then > > why bother with multi-processor algorithm? > > This is an assessor utility. > The program's architecture must be flexible, because I don't know, > where it need to run (only I have a possibility to fix this: I write > to user's guide). > > But I want to speedup my alg. with native code, and multiprocess code. > I not tested yed, but I think that 4 subprocess quickly as one large > process.
I believe you need to look at Queue module. Using Queue will help you avoid threading hell that you're afraid of (and rightly so!). Create two queues: one for jobs, another one for results, the main thread submits jobs and picks up results for results queue. As soon as number of results == number of jobs, it's time to quit. Submit N special jobs that indicate it's time to exit, where N is the number of worker threads. Then "join" the main thread with worker threads and exit the application. -- http://mail.python.org/mailman/listinfo/python-list