Hacker News new | past | comments | ask | show | jobs | submit login

I don't see that as spaghetti code at all, especially when you want to handle other things while the read() or write() is blocked. Callback-style code allows you to see the interleaving of events. If you use threads then the interleaving is non-obvious.



I guess if you don't see the interleaving in log(write(process(read(source)))) our mental models are too different to merit further discussion of this aspect.

And of course thread based code can do other things as well during blocking IO - on other threads.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: