question on timer management - Linux

This is a discussion on question on timer management - Linux ; Hi All, I am trying to start two ITIMER_REAL timers.I use the following functions getitimer and setitimer.I am keeping two separate structure members of type struct itimerval for each of the timers. But when I try to retrieve by using ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: question on timer management

  1. question on timer management

    Hi All,
    I am trying to start two ITIMER_REAL timers.I use the following
    functions getitimer and setitimer.I am keeping two separate structure
    members of type
    struct itimerval for each of the timers.

    But when I try to retrieve by using getitimer I always get the timer
    which I had started later. Even if I use the different structure
    members.
    What is the procedure to get the respective timer values correctly?
    Thanks in advance.
    Regards
    Arnab

  2. Re: question on timer management

    arnab wrote:
    > I am trying to start two ITIMER_REAL timers.I use the following
    > functions getitimer and setitimer.I am keeping two separate structure
    > members of type struct itimerval for each of the timers.


    > But when I try to retrieve by using getitimer I always get the timer
    > which I had started later. Even if I use the different structure
    > members.
    > What is the procedure to get the respective timer values correctly?


    Sorry, but there isn't one. To cite the man page: "The system pro-
    vides each process with three interval timers, each decrementing
    in a distinctctime domain." The three time domains are ITIMER_REAL,
    ITIMER_VIRTUAL and ITIMER_PROF. That means that you simply can't
    have two ITIMER_REAL timers at once. By trying to start a second
    one before the first one expired you just kill the already running
    timer.
    Regards, Jens
    --
    \ Jens Thoms Toerring ___ jt@toerring.de
    \__________________________ http://toerring.de

+ Reply to Thread