Skip to content
Better HN
Top
Best
Ask
Show
New
Jobs
Search
⌘K
0 points
sanxiyn
5y ago
0 comments
Save
Share
Synchronous code is even easier to reason about than code using async syntax sugar.
0 comments
6 comments · 1 top-level
top
newest
oldest
nialv7
5y ago
· 5 in thread
No, multithreaded synchronous code is not easier to reason about than async. I think most would agree.
sanxiyn
OP
5y ago
I disagree, at least in Rust. async is hard. Threading is easy.
nialv7
5y ago
Do you have something that backs up your belief?
akvadrako
5y ago
You probably think async code can't have deadlocks like threaded code can. Async is still multi-threaded it's just that the threads are done in user-space and contain an implicit global lock.
nicoburns
5y ago
Async is not pre-emptive though (if using a single theaded executor). And thats where most of the unintutive behaviour of threads comes from.
nialv7
5y ago
Notice I didn't say async code is easier to reason about.
j
/
k
navigate · click thread line to collapse