> Greetings,
>
> I have a loop which calls wait(), and I want another function to be
> called
> as close to once per minute as possible. Pseudo code:
>
[snip example]
>
> My concern is there is a small possibility that the alarm signal is
> delivered after the if() but before the wait. So it is
On Sun, 30 Mar 2003, [ISO-8859-1] Mikko Työläjärvi wrote:
> On Sun, 30 Mar 2003, Sean Hamilton wrote:
>
> > Dan Nelson wrote:
> > | Just make sure your signal handler has the SA_RESTART flag unset
> > | (either via siginterrupt() if the handler was installed with signal(),
> > | or directly if the
Dan Nelson wrote:
| In the last episode (Mar 30), Sean Hamilton said:
|| I'm concerned about this order of events:
||
|| - alarm()
|| - wait() returns successfully
|| - if (alarmed...) [false]
|| - SIGALRM is delivered, alarmed = true
|| - loop
|| - wait() waits indefinitely
|
| A cleaner solution
In the last episode (Mar 30), Sean Hamilton said:
> Dan Nelson wrote:
> | Just make sure your signal handler has the SA_RESTART flag unset
> | (either via siginterrupt() if the handler was installed with
> | signal(), or directly if the signal was installed with sigaction()
> | ), and the signal wi
On Sun, 30 Mar 2003, Sean Hamilton wrote:
> Dan Nelson wrote:
> | Just make sure your signal handler has the SA_RESTART flag unset
> | (either via siginterrupt() if the handler was installed with signal(),
> | or directly if the signal was installed with sigaction() ), and the
> | signal will inte
Dan Nelson wrote:
| Just make sure your signal handler has the SA_RESTART flag unset
| (either via siginterrupt() if the handler was installed with signal(),
| or directly if the signal was installed with sigaction() ), and the
| signal will interrupt the wait() call.
Er, I think you've missed my
In the last episode (Mar 30), Sean Hamilton said:
> [asked in comp.unix.programmer without much luck]
>
> I have a loop which calls wait(), and I want another function to be
> called as close to once per minute as possible. Pseudo code:
[snip]
> My concern is there is a small possibility that the
[asked in comp.unix.programmer without much luck]
Greetings,
I have a loop which calls wait(), and I want another function to be called
as close to once per minute as possible. Pseudo code:
int alarmed = 0;
void handle_sigalrm (int sig)
{
alarmed = 1;
}
while (1)
{
alarmed = 0;
ala
8 matches
Mail list logo