Peter Zotov <whitequark / whitequark.org> wrote:
> Eric Wong ڧѧ 17.12.2011 03:05:
> >Better to start with a new data structure (implemented entirely in
> >Ruby)
> >for an uncommon case.
> 
> I'm not sure that a pure Ruby implementation will be even nearly as
> efficient
> as Array on MRI. How would you implement it?

Tried a singly linked list, but object allocation overhead sucks :<

Maybe keeping the array small, swapping Thread#wakeup for Thread#run
and calling Thread#run outside of the Mutex#synchronize block
will be better...