2 ms·
Threads are necessary and pretty much unavoidable, but in my experience cooperative sharing (e.g., co-routines) results in systems that are much more reliable a
by kabdib 9y ago
Threads are necessary and pretty much unavoidable, but in my experience cooperative sharing (e.g., co-routines) results in systems that are much more reliable and far easier to reason about. Structured worker threads ("go away and tell me when you're done") with no shared resources also go a long way towards keeping systems reliable.
Don't get me wrong; I love a nice, concurrent and efficient system as much as the next guy. I've been in various kernels and embedded systems doing the whole spinlock/reader-writerlock/mutex scene, and it's fun as hell. But in the end, if I can spend a few more cycles and not have to worry about race conditions and debug hairy crashes all the time then I'm far more productive, and ultimate the customer is happier.
- psyc 9y agoAre there any coroutine systems that present a sensible call stack and the rest of the familiar debugging experience? I've only encountered systems that do not, and found them an utter nightmare to reason about.