7 ms·
> please consider using actual threads. Bad advice in general. Why would you run separate thread if you only want is to iterate over nodes in a tree (as an ex
by c-smile 3y ago
> please consider using actual threads.
Bad advice in general.
Why would you run separate thread if you only want is to iterate over nodes in a tree (as an example of non flat collection).
- rwmj 3y agoReal world and toy examples are very different. The example isn't like what people are using coroutines for in the real world. I'd urge you to look at how coroutines are used for inversion of control (quite correctly) in qemu.
- cylon13 3y agoIt’s never bad advice to consider something.
- klyrs 3y agoTo the contrary, consideration takes time, and rules of thumb are valuable to mitigate overthinking.
- a1369209993 3y agoNo, it's frequently bad advice to consider something. See eg https://www.xkcd.com/1445/ https://www.xkcd.com/1445/.
- rstuart4133 3y ago"Consider using threads" is only safe advice if the person doing the considering knows how to dealt with the (usually unwanted) non-determinism threads introduce. Only a small fraction do, but threads look so simple on the surface the rest don't realise they are walking into a mine field.