Re: using queue

2009-09-04 Thread MRAB
Tim Arnold wrote: "Jan Kaliszewski" wrote in message news:mailman.895.1251958800.2854.python-l...@python.org... 06:49:13 Scott David Daniels wrote: Tim Arnold wrote: (1) what's wrong with having each chapter in a separate thread? Too much going on for a single processor? Many more threads

Re: using queue

2009-09-03 Thread Tim Arnold
"Jan Kaliszewski" wrote in message news:mailman.895.1251958800.2854.python-l...@python.org... > 06:49:13 Scott David Daniels wrote: > >> Tim Arnold wrote: > >>> (1) what's wrong with having each chapter in a separate thread? Too >>> much going on for a single processor? > >> Many more threads t

Re: using queue

2009-09-02 Thread Jan Kaliszewski
06:49:13 Scott David Daniels wrote: Tim Arnold wrote: (1) what's wrong with having each chapter in a separate thread? Too much going on for a single processor? Many more threads than cores and you spend a lot of your CPU switching tasks. In fact, python threads work relatively the best

Re: using queue

2009-09-02 Thread Scott David Daniels
Tim Arnold wrote: "MRAB" wrote in message news:mailman.835.1251886213.2854.python-l...@python.org... I don't need that many threads; just create a few to do the work and let each do multiple chapters, something like this: a very pretty implementation with worker code: while True:

Re: using queue

2009-09-02 Thread Tim Arnold
"MRAB" wrote in message news:mailman.835.1251886213.2854.python-l...@python.org... > Tim Arnold wrote: >> Hi, I've been using the threading module with each thread as a key in a >> dictionary. I've been reading about Queues though and it looks like >> that's what I should be using instead. Jus

Re: using queue

2009-09-02 Thread MRAB
Tim Arnold wrote: Hi, I've been using the threading module with each thread as a key in a dictionary. I've been reading about Queues though and it looks like that's what I should be using instead. Just checking here to see if I'm on the right path. The code I have currently compiles a bunch of