patbalbe@disca.upv.es
P. Balbastre 2002-11-06
pthread_setinitbudget_np 3rtl pthread_setinitbudget_np pthread_getinitbudget_np set get the initial budget of a thread #include <rtl_sched.h> int pthread_setinitbudget_np pthread_t thread hrtime_t initbudget int pthread_getinitbudget_np pthread_t thread hrtime_t *initbudget DESCRIPTION This function is a non-portable Real-Time Linux extension. pthread_setinitbudget_np() and pthread_getinitbudget_np() function set and get the initbudget parameter of thread. The scheduling policy of a thread is automatically set to SCHED_CBS_NP when an initial budget is assigned with pthread_setinitbudget_np(). SCHED_CBS_NP scheduling policy efficiently handle soft real-time requests with a variable or unknown execution behaviour under EDF (SCHED_EDF_NP) scheduling policy. To avoid unpredictable delays on hard real-time tasks, soft tasks are isolated through a bandwidth reservation mechanism, according to wich each soft task is assigned a deadline, computed as a function of the reserved bandwidth and its actual requests. If a task requires to execute more than its expected computation time, its deadline is postponed so that its reserved bandwidth is not exceeded. SCHED_EDF_NP is a scheduling policy that combines both static and dynamic priority scheduling. Threads are ordered by priority, and among the same static priority threads with closer deadline first. Each thread has two scheduling attributes: priority and deadline. It is a Rate Monotonic policy and an EDF policy at each priority level. SCHED_FIFO, SCHED_RR and SCHED_EDF_NP are static priority policies, the difference is the way that each policy cope with threads of the same priority: SCHED_FIFO threads in a first in first out order; SCHED_RR thread are timesliced; and SCHED_EDF_NP threads are ordered by absolute deadline (closer absolute deadline are executed first). If all threads have different priorities, the three policies will execute threads in the same order. There are two ways to set the initbudget value of a thread: by calling pthread_setinitbudget_np() to set the initbudget of an already created thread; or before it is created at the thread creation attributes (see pthread_attr_setinitdeadline_np(3rtl)). RETURN VALUE Both always functions returns zero. ERRORS Parameter checking is not performed. Incorrect parameters may result in random errors. AUTHOR Patricia Balbastre <patricia@disca.upv.es> Pau Mendoza <pabmench@disca.upv.es> SEE ALSO pthread_attr_setinitbudget_np(3rtl), pthread_initcbs_np(3rtl),