Re: Seeking an example on using Queue to update variable while threading

2011-07-28 Thread Kushal Kumaran
On Thu, Jul 28, 2011 at 11:13 AM, Danny Wong (dannwong) wrote: > Hi Python experts, >        I'm trying to use a dict structure to store and update information > from X number of threads. How do I share this dict structure between threads? > I heard of using a queue, but I'm not familiar with ho

Seeking an example on using Queue to update variable while threading

2011-07-27 Thread Danny Wong (dannwong)
Hi Python experts, I'm trying to use a dict structure to store and update information from X number of threads. How do I share this dict structure between threads? I heard of using a queue, but I'm not familiar with how it works. Does anyone have an example of using a queue to store vari

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

using queue

2009-09-01 Thread Tim Arnold
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 chapters in a book

Re: Problems with using queue in Tkinter application

2009-07-05 Thread Icarus
On Jul 4, 11:24 am, Peter Otten <__pete...@web.de> wrote: > Icarus wrote: > > On Jul 4, 3:21 am, Peter Otten <__pete...@web.de> wrote: > >> Icarus wrote: > >> > I'm working on a serial protocol analyzer in python.  We have an > >> > application written by someone else in MFC but we need something t

Re: Problems with using queue in Tkinter application

2009-07-04 Thread MRAB
Icarus wrote: I'm working on a serial protocol analyzer in python. We have an application written by someone else in MFC but we need something that is cross platform. I intended to implement the GUI portion in Tkinter but am having trouble. The idea is that I will read messages from the serial

Re: Problems with using queue in Tkinter application

2009-07-04 Thread Peter Otten
Icarus wrote: > On Jul 4, 3:21 am, Peter Otten <__pete...@web.de> wrote: >> Icarus wrote: >> > I'm working on a serial protocol analyzer in python. We have an >> > application written by someone else in MFC but we need something that >> > is cross platform. I intended to implement the GUI portio

Re: Problems with using queue in Tkinter application

2009-07-04 Thread Icarus
On Jul 4, 3:21 am, Peter Otten <__pete...@web.de> wrote: > Icarus wrote: > > I'm working on a serial protocol analyzer in python.  We have an > > application written by someone else in MFC but we need something that > > is cross platform.  I intended to implement the GUI portion in Tkinter > > but

Re: Problems with using queue in Tkinter application

2009-07-04 Thread Peter Otten
Icarus wrote: > I'm working on a serial protocol analyzer in python. We have an > application written by someone else in MFC but we need something that > is cross platform. I intended to implement the GUI portion in Tkinter > but am having trouble. > > The idea is that I will read messages from

Problems with using queue in Tkinter application

2009-07-03 Thread Icarus
I'm working on a serial protocol analyzer in python. We have an application written by someone else in MFC but we need something that is cross platform. I intended to implement the GUI portion in Tkinter but am having trouble. The idea is that I will read messages from the serial port and output