Trying to wrap my head around coroutines. In my game I have multithreaded world generation. At least for most of it, simply by dividing the world into n parts where n is number of threads I feel like.
There's a client thread and a server thread (on the same system, ie singleplayer). The server thread launches a thread ("world gen thread" which sets stuff up and itself launches n threads to start creating the world. Server thread will need to know when it is finished. And the client thread needs to know that plus I'm thinking regular status updates.. Like a queue of loading statuses it can dequeue, (so that I can try and show progress and such)
Probably the "world gen thread" will create n threads, join them all and perhaps later on create n more (different world gen passes, some are naturally thread able and others you need to move back to synchronous).
The status updates might be a little tricky because that main world gen thread would need to grab statuses from the children threads, or itself (if say we're doing some final passes after all those threads join). It would then have to give that info to the client thread somehow, continuously