0

can any one tell me how to create a time task which will execute the task periodically if the Particular message is not received within time. the Message receiving is another separate thread.

eg. if message1 is not received within 5 min in thread 1 then the thread 2 executed a task and again starts to monitor for next 5 min if message received the thread 2 should not execute the task but keep on monitor for next 5 min ..

this process is ever running Process..

Balamurugan
  • 2,259
  • 8
  • 33
  • 48

1 Answers1

0

If unde Windows, you can use CreateProcess and WaitForSingleObject methods. I believe you can pass a timeout to WaitForSingleObject.

If *nix, check out the functionality of fork()/wait().

Luchian Grigore
  • 253,575
  • 64
  • 457
  • 625