--- In [email protected], "brucexs" <bswit...@...> wrote: > > --- In [email protected], "entropyreduction" > <alancampbelllists+yahoo@> wrote: > > > > At the moment, design is: thread is launched, and waits on event. > > > > When there's something to do (aka a com service to perform), main thread > > sets up some stuff (mainly a pointer to a object that knows how to do that > > service), sets the event that gets the worker thread out of its wait, and > > then itself waits on another event. > > Can every thread wait be a multi-event wait, where one of the events is > always "die now" and which is set by the main thread.
There's only ever one worker thread. It has nothing to wait for except the signal from main thread to run. It does that and then waits again. > Could try the com clean up when die now received. That's how it's meant to work. Some of the com cleanup is same as com.release_all and has to therefore be done on worker thread that created and stored handles to com objects in first place. > My main in file just polls a global nThreads which threads increment when > they start and decrement when they die. It would be cleaner to wait on all > the outstanding thread handles, but I did not want to keep track of each > handle from each file.runwait. Yeah, saw that. Since in my case it's just one thread, I can just wait on that thread's handle.
