Queue.Queue examples? 
Author Message
 Queue.Queue examples?

    Dave> despite having read the manual, i'm still totally ignorant on the
    Dave> basic concept of Queue and how can it be used to safely pass
    Dave> objects between two (or more) threads. could someone enlighten me?

Suppose you have a Queue object:

    q = Queue.Queue()

In one thread you can execute:

    q.put(someobj)

In another thread you can execute:

    someobj = q.get()

--
Skip Montanaro

consulting: http://www.*-*-*.com/ ~skip/resume.html



Sat, 08 Jan 2005 22:38:11 GMT  
 Queue.Queue examples?
despite having read the manual, i'm still totally ignorant on the basic
concept of Queue and how can it be used to safely pass objects between
two (or more) threads. could someone enlighten me?

--
dave



Sat, 08 Jan 2005 22:23:11 GMT  
 Queue.Queue examples?


Quote:

>despite having read the manual, i'm still totally ignorant on the basic
>concept of Queue and how can it be used to safely pass objects between
>two (or more) threads. could someone enlighten me?

See the thread tutorial on my web page for some examples.
--

Project Vote Smart: http://www.vote-smart.org/



Sun, 09 Jan 2005 01:47:25 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. CLASSes and QUEUEs (was: Re: QUEUE in QUEUE)

2. How to make a queue of queue's

3. Clarification of Queue Operation / Behavior when using multiple Queues

4. Queue in Queue?!

5. Queue of Queues problem.

6. QUEUE in QUEUE

7. QUEUE inside GROUP/QUEUE

8. Howto wait for multiple queues (Queue.py)?

9. Does the "max queue size" input make a LV 6.1 Queue a constant size?

10. multi-queues

11. Implementing a Queue

12. Windows events queue

 

 
Powered by phpBB® Forum Software