You may need to experiment with different fasthz values in order to produce a repeatable, short interval. The requested interval is rounded up to whole multiples of 10 milliseconds. For normal processes-that is, processes not running at a nondegrading priority in the real-time band-no interval shorter than 10 milliseconds can be scheduled. In all recent versions of IRIX, HZ=100, so T, the minimum itimer interval, is 10 milliseconds. The smaller the value of T, the more frequently the kernel must inspect all timers.īy default, T is one second divided by the value HZ defined in /usr/include/sys/param.h. The key point is the value of the interval T at which the kernel updates timers. If the result is negative, the kernel processes the timer event: it sends the signal, and either removes the timer from the list or restarts it with a new interval, depending on _interval. On each timer interrupt, T is deducted from the it_value field of each active itimerval structure. The kernel arranges to be interrupted at a regular interval of length T. The kernel keeps active itimerval structures in a list. Then it initializes the itimer, using a period passed as an argument. It establishes uponSigalrm() as the signal handler. The periodic timer is initialized in the function setUpTimer(). For another method based on sigsuspend(2), see “Interprocess Communication” in Appendix A on page 220.) (This is one of many possibilities for interaction between the signal handler and the main process. When the main process has completed its work for one interval and is ready to wait until the next interval, it will perform the P (count-down, de plete) operation on the same semaphore. This handler performs the V (count-up, re vi ve) operation on a semaphore. The example begins by defining a signal-handling function, uponSigalrm(). If (setitimer(ITIMER_REAL, &period, NULL)) If (sigaction(SIGALRM, & alarmActor, NULL)) Usema_t * alarmSema /* initialized elsewhere */
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |