LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   analog WaitForSingleObject for Unix or any interuptible timer (https://www.linuxquestions.org/questions/programming-9/analog-waitforsingleobject-for-unix-or-any-interuptible-timer-287038/)

Chris_tt 02-06-2005 05:09 PM

analog WaitForSingleObject for Unix or any interuptible timer
 
I am porting one small program on C from Windows to Linux and have got a problem. I have sort of "interruptible timer" - I implemented it using WaitForSingleObject with Event and timeout. I am waiting for some Event which can interrupt this waiting. I need to have the same on Linux platform where I am unfortunately a newbie. So my question is: if exist any way to do it - let my know if somebody know what can be used for implementation of this conception on *nix platform?

jim mcnamara 02-07-2005 10:21 AM

unix uses signals (Windows uses messages, which you call events).

Create a signal handler that will repsond to SIGALRM or SIGVTALRM.

Download the free book - Advanced Linux Programming

http://www.advancedlinuxprogramming.com/alp-folder

Chris_tt 02-07-2005 02:35 PM

Thank you very much for advice and link, I'll try to use it


All times are GMT -5. The time now is 06:09 PM.