Re: Producer/consumer Queue "trick"

2005-01-17 Thread Evan Simpson
Nick Coghlan wrote: Paul Rubin wrote: That's weird. Preemption should happen every few dozen milliseconds unless you've purposely increased the preemption delay. To me, it smells like a call into a C extension which isn't releasing the GIL before starting a time-consuming operation. Sorry, I thi

Re: Producer/consumer Queue "trick"

2005-01-17 Thread Evan Simpson
Jon Perez wrote: If the consumer and the producer are separate threads, why does the consumer thread block when the producer thread is generating a new board? Or why does it take forever for the producer thread to be pre-empted? Also, I don't understand why the solution works. How does sleeping fo

Re: Producer/consumer Queue "trick"

2005-01-17 Thread Evan Simpson
I should clarify up front that I may have given an overblown sense of how long the producer thread typically takes to generate a board; It's usually a few tenths of a second, up to a few seconds for especially fecund boards. My concern was that even a few seconds is long enough for fifty reques

Re: Producer/consumer Queue "trick"

2005-01-15 Thread Jeremy Bowers
On Fri, 14 Jan 2005 16:26:02 -0600, Evan Simpson wrote: > WEBoggle needs a new game board every three minutes. Boards take an > unpredictable (much less than 3min, but non-trivial) amount of time to > generate. I gotta ask, why? Looking over your information about "how to play", my only guess

Re: Producer/consumer Queue "trick"

2005-01-15 Thread Nick Coghlan
Paul Rubin wrote: Evan Simpson <[EMAIL PROTECTED]> writes: wakes up the producer, which has been blocked waiting to add a board to the Queue. It sets about generating the next board, and the consumer doesn't get to run again until the producer blocks again or is preempted. That's weird. Preempti

Re: Producer/consumer Queue "trick"

2005-01-15 Thread Paul Rubin
Evan Simpson <[EMAIL PROTECTED]> writes: > wakes up the producer, which has been blocked waiting to add a board > to the Queue. It sets about generating the next board, and the > consumer doesn't get to run again until the producer blocks again or > is preempted. That's weird. Preemption should

Re: Producer/consumer Queue "trick"

2005-01-15 Thread Jon Perez
I don't get it. If the consumer and the producer are separate threads, why does the consumer thread block when the producer thread is generating a new board? Or why does it take forever for the producer thread to be pre-empted? Also, I don't understand why the solution works. How does sleeping for

Re: Producer/consumer Queue "trick"

2005-01-14 Thread John Lenton
On Fri, Jan 14, 2005 at 04:26:02PM -0600, Evan Simpson wrote: > WEBoggle needs a new game board every three minutes. Boards take an > unpredictable (much less than 3min, but non-trivial) amount of time to > generate. The system is driven by web requests, and I don't want the > request that happ