Re: A little threading problem

2004-12-02 Thread Alban Hertroys
Jeremy Jones wrote: * the get method on a queue object has a "block" flag. You can effectively poll your queues something like this: #untested code #a_done, b_done and c_done are just checks to see if that particular document is done while not (a_done and b_done and c_done): got_a, got_b, go

Re: A little threading problem

2004-12-02 Thread Jeremy Jones
Alban Hertroys wrote: Jeremy Jones wrote: (not waiting, because it already did happen). What is it exactly that you are trying to accomplish? I'm sure there is a better approach. I think I saw at least a bit of the light, reading up on readers and writers (A colleague showed up with a book cal

Re: A little threading problem

2004-12-02 Thread Alban Hertroys
Jeremy Jones wrote: (not waiting, because it already did happen). What is it exactly that you are trying to accomplish? I'm sure there is a better approach. I think I saw at least a bit of the light, reading up on readers and writers (A colleague showed up with a book called "Operating system

Re: A little threading problem

2004-12-02 Thread Alban Hertroys
Jeremy Jones wrote: Alban Hertroys wrote: Notify is called before thread B (in this case) hits the condAllowed.wait() piece of code. So, it sits at that wait() for forever (because it doesn't get notified, because the notification already happened), waiting to be notified from the main thread,

Re: A little threading problem

2004-12-01 Thread Jeremy Jones
Alban Hertroys wrote: Hello all, I need your wisdom again. I'm working on a multi-threaded application that handles multiple data sources in small batches each time. The idea is that there are 3 threads that run simultaneously, each read a fixed number of records, and then they wait for e

A little threading problem

2004-12-01 Thread Alban Hertroys
Hello all, I need your wisdom again. I'm working on a multi-threaded application that handles multiple data sources in small batches each time. The idea is that there are 3 threads that run simultaneously, each read a fixed number of records, and then they wait for eachother. After that the main