4 Jul
2014
4 Jul
'14
10:54 a.m.
2014-07-04 11:52 GMT+02:00 Benedek Thaler
What if the second element cannot be pushed to the downstream queue because it's full? The transformation should yield (and not spin).
that problem could be solved by fibers - if a fiber would enqueue an item in a bounded-queue and the queue is full, the fiber is suspended and the thread can resume another fiber (executing another transformation). if items are removed from the bounded-queue, the waiting fiber gets notified an will be resumed, e.g. is able to enqueue its item.