Queue get timeout parameter question

Godzilla godzillaismad at gmail.com
Tue Apr 10 00:10:32 EDT 2007


Dear all,

I have been using the queue module for a multithreaded environment and
things seem to work well... until we had a requirement for the
application to be able to time sync to the server. With the time sync,
it actually disorientated the timeout in the queue's get() method...
e.g.

get(item, 2.0)

After the time sync, say 15 seconds backward, the thread is sitting on
that get() method for a total of 17 seconds. We can only sync the
device once per day and the time can drift up to 15 seconds per day!!
I had tried to get around this problem by having a sleep(2) (sleep is
not local system time dependant) just before the get(), but that will
slow down the application too much.

Anyone knows a solution to this problem or an alternative method?




More information about the Python-list mailing list