0

I am looking for a Windows replacement for the *nix SIGALRM. I have seen suggested (e.g. here) to use timeSetEvent, but that doesn't quite do the same. SIGALRM calls the callback function on the same thread as the rest of my (single threaded) program, where as, as far as I understand, timeSetEvent calls it on a new thread.

Am I right about this distinction? If so, is there some way to achieve the *nix type behavior on Windows?

Community
  • 1
  • 1
Baruch
  • 20,590
  • 28
  • 126
  • 201
  • Your assumptions are not correct: http://stackoverflow.com/questions/2586926/setitimer-sigalrm-multithread-process-linux-c – Hans Passant Nov 20 '12 at 18:49
  • @HansPassant No, that answer says that the signal is handled by one of the *existing* threads. Since this is a single-threaded application, my assumption that the callback is handled on my main thread is correct. `timeSetEvent`, if I understand correctly, creats a whole new thread to handle the callback. – Baruch Nov 20 '12 at 19:58

0 Answers0