Visit Our UNIX and Linux User Community

Linux and UNIX Man Pages

Test Your Knowledge in Computers #933
Difficulty: Medium
Microcontrollers operating within embedded systems (such as the Raspberry Pi, Arduino, and other similar systems) always have internal hardware to keep track of time.
True or False?
Linux & Unix Commands - Search Man Pages

schedule_hrtimeout_range(9) [centos man page]

SCHEDULE_HRTIMEOUT_R(9) 					   Driver Basics					   SCHEDULE_HRTIMEOUT_R(9)

schedule_hrtimeout_range - sleep until timeout SYNOPSIS
int __sched schedule_hrtimeout_range(ktime_t * expires, unsigned long delta, const enum hrtimer_mode mode); ARGUMENTS
expires timeout value (ktime_t) delta slack in expires timeout (ktime_t) mode timer mode, HRTIMER_MODE_ABS or HRTIMER_MODE_REL DESCRIPTION
Make the current task sleep until the given expiry time has elapsed. The routine will return immediately unless the current task state has been set (see set_current_state). The delta argument gives the kernel the freedom to schedule the actual wakeup to a time that is both power and performance friendly. The kernel give the normal best effort behavior for "expires+delta", but may decide to fire the timer earlier, but no earlier than expires. You can set the task state as follows - TASK_UNINTERRUPTIBLE - at least timeout time is guaranteed to pass before the routine returns. TASK_INTERRUPTIBLE - the routine may return early if a signal is delivered to the current task. The current task state is guaranteed to be TASK_RUNNING when this routine returns. Returns 0 when the timer has expired otherwise -EINTR COPYRIGHT
Kernel Hackers Manual 3.10 June 2014 SCHEDULE_HRTIMEOUT_R(9)

Check Out this Related Man Page

iv_task(3)						    ivykis programmer's manual							iv_task(3)

iv_task_register, iv_task_unregister, iv_task_registered - deal with ivykis tasks SYNOPSIS
#include <iv.h> struct iv_task { void *cookie; void (*handler)(void *); }; void IV_TASK_INIT(struct iv_task *task); void iv_task_register(struct iv_task *task); void iv_task_unregister(struct iv_task *task); int iv_task_registered(struct iv_task *task); DESCRIPTION
The functions iv_task_register and iv_task_unregister register, respectively unregister, a task with the current thread's ivykis event loop. iv_task_registered on a task returns true if that task is currently registered with ivykis. A task is like a timer, but with an immediate timeout. When a task is registered, unless it is unregistered again first, the callback function specified by ->handler is guaranteed to be called once, in the thread that the task was registered in, some time after control returns to the ivykis main loop but before ivykis will sleep for more events, with ->cookie as its first and sole argument. When this hap- pens, the task is transparently unregistered. Tasks are mainly used for scheduling code for execution where it is not appropriate to directly run that code in the calling context (for example, because the current context might be run as a callback function where the caller expects certain conditions to remain invariant after the callback completes). The application is allowed to change the ->cookie and ->handler members at any time. A given struct iv_task can only be registered in one thread at a time, and a task can only be unregistered in the thread that it was regis- tered from. There is no limit on the number of tasks registered at once. See iv_examples(3) for programming examples. SEE ALSO
ivykis(3), iv_examples(3) ivykis 2010-08-15 iv_task(3)

Featured Tech Videos