Controlling threads
Posted: Fri Jan 04, 2013 4:33 pm
Hi,
I have a monitor thread that I would like to monitor ADC values under some algorithm. What is the best way to start/stop this thread from a controller thread? I would like to start it and stop it once a result has been found.
thought about using a binary semaphore, and waiting on the semaphore in the first statement of the while TRUE loop. The other thread would then signal the monitor thread to continue. However, when it reaches the top of the while loop the thread will suspend again. I would like it to continue until some point in the future determined by the controller thread.
Does anyone have any suggestions?
I have a monitor thread that I would like to monitor ADC values under some algorithm. What is the best way to start/stop this thread from a controller thread? I would like to start it and stop it once a result has been found.
thought about using a binary semaphore, and waiting on the semaphore in the first statement of the while TRUE loop. The other thread would then signal the monitor thread to continue. However, when it reaches the top of the while loop the thread will suspend again. I would like it to continue until some point in the future determined by the controller thread.
Does anyone have any suggestions?