|
|
|
|
|
by btrask
2002 days ago
|
|
Whether it's kernel threads or green threads, the same patterns (locks, etc) are possible. Locks are supposed to be the borrow checker's bread and butter, because it can guarantee they are held before accessing shared state. But now you're saying "the borrow checker makes writing code without [async/await] difficult, inefficient, and unergonomic." I'm not saying locks are better than async/await (although they are[1]). You're saying the borrow checker itself can't handle them in real world use? [1] https://journal.stuffwithstuff.com/2015/02/01/what-color-is-... |
|
(The borrow checker does not understand locks as a special construct, to be extra clear.)
Did you read the post I linked? It lays out the details. I am happy to clarify if you don’t get the specifics.