Hugo González Monteverde wrote:
> You are not using the optional timeout and blocking which 'get' provides (!)
> 
> Try setting it and see your CPU usage go down. This will implement 
> blocking, and the queue will be used as soon as data is there.        Set 
> block 
> to True and a timeout if you need to use it (looks like you only need 
> blocking)
> 
>          while True:
>               try:
>                  data = self.queue.get(True)
>                  self.DAO.send_data(data)

I think he will need the timeout too, otherwise the shutdown flag will 
only be checked when there is work which is probably not what he wants.

I agree, this is a good solution.

Kent

_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to