3 ms·
You can write horrible event driven code. For example, do your events need to talk to a database? Right there, you've got a synchronization point. Thinking abo
by oppositelock 7y ago
You can write horrible event driven code. For example, do your events need to talk to a database? Right there, you've got a synchronization point.
Thinking about asynchronous behavior is always tricky, and code designed to run on threaded systems isn't generally arbitrary code with locks thrown into it the mix, you strive to write the largest possible reentrant sections, and only lock where you have to, and as infrequently as possible. With reentrant code, it doesn't matter where you get preempted.
- lmm 7y ago> For example, do your events need to talk to a database? Right there, you've got a synchronization point. Not if you do it right. Interacting with sync-only systems from async systems is a problem, but it's not fair to blame that on async - if you make the whole system work async, you don't have that problem.