Re: Pausing and Unpausing Threads

2007-08-13 Thread Aaron J. M.
On Aug 13, 2:31 am, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > Use the same Queue; put a special kind of Action, or just a None object, > to tell the thread that there are no more things to process. > From the main thread, you can join() the others, waiting for them to > finish. Ah, thank y

Re: Pausing and Unpausing Threads

2007-08-12 Thread Gabriel Genellina
En Sun, 12 Aug 2007 21:45:47 -0300, Aaron J. M. <[EMAIL PROTECTED]> escribi�: > Uhg, I thought of something I didn't consider before: how to cleanly > end the Server/DirectedControl(l)er process. Use the same Queue; put a special kind of Action, or just a None object, to tell the thread that

Re: Pausing and Unpausing Threads

2007-08-12 Thread Aaron J. M.
Uhg, I thought of something I didn't consider before: how to cleanly end the Server/DirectedControl(l)er process. Assuming that the Client only sends Actions to the DirectedController while the DirectedController is in its turn() method (which I would probably regulate using some flag in DirectedC

Re: Pausing and Unpausing Threads

2007-08-12 Thread Aaron J. M.
On Aug 12, 3:55 pm, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: > By this definition, if there is no "action" supplied, a > "DirectedControler" will result in blocking ALL others (directed or not) > in this "server" (as it blocks the entire server thread). > > Is that really the be

Re: Pausing and Unpausing Threads

2007-08-12 Thread Martin v. Löwis
> I'm worried that this loop may wast some CPU cycles, and wonder if > there's a better way through thread synchronization using such things > as Events or Conditions. Typically, people are after the Queue module in such cases. Each DirectedControl(l)er would have an instance of the Queue class, a

Pausing and Unpausing Threads

2007-08-11 Thread Aaron J. M.
Hello, This is a question about how to pause and unpause threads (as the title suggests). I've created an extension of threading.Thread which I'll call Server. Server has a collection of Controlers. A Controler has a method turn(), which lets it do various interesting things. While the Server i