Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Timers

6,640 views

Published on

Published in: Technology
  • Be the first to comment

Timers

  1. 1. © 2010-17 SysPlay Workshops <workshop@sysplay.in> All Rights Reserved. Timers
  2. 2. 2© 2010-17 SysPlay Workshops <workshop@sysplay.in> All Rights Reserved. What to Expect? Alarm based Trivial Timer Interval Timers based on other Signals
  3. 3. 3© 2010-17 SysPlay Workshops <workshop@sysplay.in> All Rights Reserved. Trivial Timer Based on the alarm signal (SIGALRM) One Timer per Process Timer resolution is in seconds Activated using the alarm() system call Any subsequent calls to alarm cancels the previous ones, if not already triggered Triggered after seconds specified in last alarm() call SIGALRM handler is the timer handler One shot behaviour, unless activated again
  4. 4. 4© 2010-17 SysPlay Workshops <workshop@sysplay.in> All Rights Reserved. Other User Space Timers Based on Interval Timers Total of three timers possible per Process ITIMER_REAL (Based on real time) – SIGALRM ITIMER_VIRTUAL (Based on execution time) – SIGVTALRM ITIMER_PROF (Based on overall execution time) – SIGPROF Timer Resolution is in micro seconds Though expiry may be a little later Activated using setitimer system call And can be queried using gettimer system call Triggered Periodically, every interval, after current value As specified in the setitimer call From the call to setitimer
  5. 5. 5© 2010-17 SysPlay Workshops <workshop@sysplay.in> All Rights Reserved. Other User Space Timers ... POSIX.1-2008 marks the setitimer / getitimer calls obsolete Rather recommends the following timer_settime, timer_gettime timer_create, timer_delete timer_getoverrun With these, many more interval timers could be used Using signals other than the 3 usual ones Also including the real-time signals
  6. 6. 6© 2010-17 SysPlay Workshops <workshop@sysplay.in> All Rights Reserved. What all have we learnt? Alarm based Trivial Timer Interval Timers based on other Signals
  7. 7. 7© 2010-17 SysPlay Workshops <workshop@sysplay.in> All Rights Reserved. Any Queries?

×