timer issue

I have 100 timers running. If a timer is expired which will generate a signal and it is mapped to a specific function handler.

The problem is if the timer expires one at a time, the function handler is been called. But if the 2 timers expires at a time, the function handler is called one time only instead 2 times.

Is it possible to call the function handler 2 times?

If anyone knows the solution to this problem please let me know.

Regards

Uma

Hi,

in what are you trying to program these timers?

Lenwolf

lenwolf wrote:
> in what are you trying to program these timers?

At least! Or better yet, post the code …

(i.e. a small but complete program that demonstrates the problem)

int timer_start(int timer_id, int expiry_time)
{
/* Variable Declaration */
struct timespec ts, tm, sleep;
sigset_t mask;
siginfo_t info;
struct sigevent sigev;
struct sigaction sa;

/* Set the signal handler to handle the SIGRTMIN signal */
sa.sa_flags = SA_SIGINFO;
sigemptyset(&sa.sa_mask);
sa.sa_sigaction = timer_handler;

if(sigaction(SIGRTMIN, &sa, NULL) == -1)
{
	perror("Sig action failed");
	return -1;
}

sigev.sigev_notify = SIGEV_SIGNAL;
sigev.sigev_signo = SIGRTMIN;
sigev.sigev_value.sival_int = timer_id;

/* Set the timeout values in the timer */
if(timer_settime(tid, 0, &ival, NULL) == -1)
{
perror(“timer_settime”);
return -1;
}
return 1;
}

void timer_handler(int sing_no, siginfo_t *info, void context)
{
/
Variable declaration /
/
Call to initiate the configuration function call */

}

How To Ask Questions The Smart Way