Re: Interval timers on Fedora

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





John Wendel wrote:
Douglas Phillipson wrote:
This probably isn't a Fedora specific question so I apologize if this is the wrong forum.

Anybody know if you can set more than one interval timer in a single process?

(setitimer())

Would starting more than one interval timer in a single process confuse the signal system when delivering the SIGALRM to the receiving process?

In other words, can I have a 10 second interval timer which when times out delivers a sigalrm to one function, and in the same process have a 1 second interval timer set to give a sigalrm to another function?

I'm having trouble with a second interval timer, it doesn't seem to work, or deliver the signal to the desired function. I'm using a separate instance of struct itimerval and struct sigaction when setting up the timers. I have several books on the subject of interval timers but none say you shouldn't do this, just "Every process has its own set of timers". But they might be referring to REAL, VIRTUAL, and PROF timers, a single set of these for each process.

Opinions requested...

Thanks

Doug P


I'm not an expert on this stuff, but my understanding is that setitimer gives your process access to one of three predefined timers (REAL, VIRTUAL, and PROF) and only the REAL timer is actually useful. So your second call to setitimer is mucking up the settings from the first call.

See "man timer_create" for the POSIX timer stuff that lets you have lots of timers.

I recommend the O'REILLY book POSIX 4 by Bill Gallmeister for a good explanation of this fairly complicated topic.

Regards,

John


My result on the timer issue is that a interval timer won't call its timeout function while msgrcv() is waiting for a message on a queue.

Regards

Doug P

--
fedora-list mailing list
fedora-list@xxxxxxxxxx
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [Fedora Magazine]     [Fedora News]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Maintainers]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Legacy]     [Fedora Desktop]     [Fedora Fonts]     [ATA RAID]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [SSH]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Centos]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Tux]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Asterisk PBX]     [Fedora Sparc]     [Fedora Universal Network Connector]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux