19 ms·
>... the very idea of using bare threads and callbacks to manage that is annoying. Yeah, that's an extremely painful way to write threaded code. Much more nor
by Groxx 6y ago
>... the very idea of using bare threads and callbacks to manage that is annoying.
Yeah, that's an extremely painful way to write threaded code. Much more normal is to simply block your thread while waiting for others to .Join() and return their results, likely behind an abstraction layer like a Future.
The only time you really need to use callbacks is when you need to blend async and threaded code, and you aren't able to block your current thread (e.g. Android main thread + any thread use is an example of this). But there are much much easier ways to deal with that if you need to do it a lot - put your primary logic in a different, blockable thread.