2 ms·
>Sure, you can be preempted by another thread (or even process) even within an async function, so why should it matter? You misunderstand. Its not about wheth
by jayd16 5y ago
>Sure, you can be preempted by another thread (or even process) even within an async function, so why should it matter?
You misunderstand. Its not about whether your thread can be pre-empted, its that your logical execution can hold exclusive access to a thread. There are common design patterns that use exclusive threads as a means of synchronization.
- gpderetta 5y agoI understand. What I'm saying is that marking async points explicitly is neither necessary nor sufficient to guarantee exclusive use of the thread. The borrow checker or some other explicit critical section markers are a better soluiton.