News for hackers. Stuff that matters.
Re:Show HN: Libconcurrent – Coroutines in C by avdicius on Wednesday January 13, 2016 @04:33PM (#10897689)
I use pthreads and coroutines (actually fibers) inside pthreads and lock-free bounded queues to communicate between pthreads. All pthreads execute coroutines until all of them get blocked, then pthreads go to epoll. If a pthread gets a socket readiness notification for a socket it owns or an orphan socket then it handles I/O itself, without any synchronization. If a socket is owned by a coroutine running on a different pthread then the notification is forwarded to that pthread via the bounded queue. The project is called MainMemory, and it is just here on Show HN.

There are no comments on this comment yet.