PyPy und queue.get_nowait()
Verfasst: Donnerstag 7. August 2014, 17:55
Hab eine einfache Schleife:
Obwohl ein get_nowait() nicht blockieren sollte und ein Queue.Empty werfen sollte, klappt das unter PyPy 2.3.1 unter windows nicht. Mit CPython funktioniert es wie es soll.
Hab schon verschiedenes als work-a-round probiert, aber ohne Erfolg
Bei https://docs.python.org/2.7/library/queue.html steht noch der Hinweis:
Wo genau liegt der Unterschied?
Code: Alles auswählen
def display_queue_interval(self, interval):
while True:
try:
cpu_cycles, op_address, address, value = self.display_queue.get_nowait()
except Queue.Empty:
break
else:
self.display.write_byte(cpu_cycles, op_address, address, value)
self.root.after(interval, self.display_queue_interval, interval)
Hab schon verschiedenes als work-a-round probiert, aber ohne Erfolg

Bei https://docs.python.org/2.7/library/queue.html steht noch der Hinweis:
Könnte also collections.deque eine Alternative sein?See also: collections.deque is an alternative implementation of unbounded queues with fast atomic append() and popleft() operations that do not require locking.
Wo genau liegt der Unterschied?