3 ms·
> A disadvantage of the ‘no function coloring’ in fibers is that it makes lockless programming harder. But if you treat fiber-style coroutines like threads, an
by munch117 3y ago
> A disadvantage of the ‘no function coloring’ in fibers is that it makes lockless programming harder.
But if you treat fiber-style coroutines like threads, and use locks and message queues exactly the same as you would with threads (although differently implemented, of course), then coroutines are basically better-behaved, and nicely deterministic, threads. It's a wonderful programming model, with the one big drawback that you can't take advantage of multiple cores.