(= q (queue))
(def verify(q)
(prn q)
(if q.0
; The contract for queues: q.1 is reachable from q.0
(unless (reclist [is _ q.1] q.0)
(prn "error"))))
(repeat 1000000
(prn "iter")
(repeat rand.10
(verify q)
(enq 0 q))
(prn "deq")
(until (is 0 qlen.q)
(verify q)
(deq q)))
On EC2+ubuntu jaunty+mzscheme 4.2.4/4.1.3 this dies with an error 4 out of 5 times. Every now and then enq seems to reset the queue's tail pointer.No error in snow leopard with mzscheme 4.2.2. Could y'all try it out on platform/version combos you have access to, and post the results? Relevant is this comment above the implementation of enq: ; Despite call to atomic, once had some sign this wasn't thread-safe.
; Keep an eye on it.
|