Hrm.. I've just been playing around with threads a bit... and I wonder... If I suspend a thread it seems like it stays at the same plays where it got suspended... and then keeps on going from that same place again when I resume it... That's not quite what I was searching for tho :( (I thought it would go to it's starting point and wait there for me to get activated again...)

Should I just set up a flag which guides the thread out and create it everytime anew when I need it or does anyone have a better idea?

Thanks in advance,
JClif
Posted on 2002-01-16 16:13:55 by JimmyClif
Of course suspend/resume can't make the thread go to it's starting
point - too much state information could be messed up (registers,
stack, state of various "objects" like files or whatnot). Destroying
and recreating the thread might be okay, but there is some overhead
to this. You could use an EVENT object and make your thread wait
for that at the start of the threadproc, and have your main app
signal the event whenever the thread should have a go (use automatic
reset).
Posted on 2002-01-17 06:51:21 by f0dder
Thanks f0dder... It works out fine with an Event :)
Posted on 2002-01-17 19:43:32 by JimmyClif