TimeToDelay = 600;
TimeToPrint = 325;
{
//When I want to print the message I am entering:
_os_sleep(&TimeToPrint,&dummysignal);
//Then when I want to send it I simple delay the process by using:
_os_sleep(&TimeToDelay,&dummysignal);
There is 5 processes and the startup must fork them. Is there
something wrong with my sleep syntax or what is the probable cause of
the issue?
Regards,
Jer
1. _Always_ check the return value whenever you call an _os_*()
function. If you get an error you need to handle that error.
2. Remember that _os_sleep() wakes early if the process gets a signal.
(If you don't have a signal handler the process will be terminated, so
you must have a signal handler.) Always put _os_sleep() in a loop so
that the full sleep time is completed even if it gets woken by a
signal.
3. Consider using alarms rather than timed sleeps.
4. Pipes show up in the filing system with the path /pipe/<name>. You
can use shell functions like dir -e to examine what pipes have been
created, and look at their contents with dump. A pipe will continue to
exist until all the data has been read from it, so if you have pipes
lying around it means the reader hasn't completed its task.
Please let us know how you get on. By sharing your answer you
encourage other people to make suggestions.