sigevent and threads

anybody please, help me out , how to use sigevent …suppose I’m using thread for receiving serial data and want to inform our main process whenever the data is available for receiving through signals and want to add one timeout signal for receiving the data… any helping code…

There is an excellent example in the helpviewer documentation on doing exactly what you want to do assuming the timeout signal you are talking about is on the server (main) side and not on the client (serial receive) side.

Search for ‘sigevent’ in the helpviewer.

Then select the ‘how to fill in the sigevent structure’ entry from the list of matches.

Scroll down till you see the title ‘A server with periodic pulses’.

There you will find 4 functions and a main that show exactly what you want to do on the server side (your main process).

The client side (your serial thread) is much simpler code wise. So get the server side done 1st then tackle the client side.


Thank you sir,
your advice was quite helpful to me.
I got necessary and some useful information…