this post was submitted on 28 Jan 2024
618 points (95.0% liked)

Programmer Humor

32410 readers
2 users here now

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

founded 6 years ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[โ€“] agressivelyPassive@feddit.de 9 points 2 years ago (38 children)

I honestly don't know, why async got so popular. It seems like the entire reason for doing it was that some blokes were hellbent on using JS on a server and couldn't fathom that a second thread might be a good idea.

[โ€“] sebsch@discuss.tchncs.de 9 points 2 years ago* (last edited 2 years ago)

Imagine a webser or proxy and for every incoming request it creates an new thread ๐Ÿ’ฃ

Yes you're right if it's a second or third thread it is/may be fine. But if you're i/o bound and your application has to manage quite a lot of that stuff in parallel, there is no way around delegating that workload to the kernel's event loop. Async/Await is just a very convenient abstraction of that Ressource.

load more comments (37 replies)