All of lore.kernel.org
 help / color / mirror / Atom feed
* [Xenomai] Setting execution time limit of task?
@ 2015-02-03 23:46 Steve B
  2015-02-04  8:37 ` Philippe Gerum
  0 siblings, 1 reply; 2+ messages in thread
From: Steve B @ 2015-02-03 23:46 UTC (permalink / raw)
  To: xenomai

Hello,

Related to my troubleshooting thread of the last couple days, but this is a
separate and simple question.

In POSIX skin is there a way of assigning a high-priority RT thread/task a
timeslice such that it must yield execution if it exceeds its allotted
time? Or is this only possible in the native skin?


Is this what SCHED_RR allows us to do?

Thanks,

Steve

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [Xenomai] Setting execution time limit of task?
  2015-02-03 23:46 [Xenomai] Setting execution time limit of task? Steve B
@ 2015-02-04  8:37 ` Philippe Gerum
  0 siblings, 0 replies; 2+ messages in thread
From: Philippe Gerum @ 2015-02-04  8:37 UTC (permalink / raw)
  To: Steve B, xenomai

On 02/04/2015 12:46 AM, Steve B wrote:
> Hello,
> 
> Related to my troubleshooting thread of the last couple days, but this is a
> separate and simple question.
> 
> In POSIX skin is there a way of assigning a high-priority RT thread/task a
> timeslice such that it must yield execution if it exceeds its allotted
> time? Or is this only possible in the native skin?
> 


> 
> Is this what SCHED_RR allows us to do?
> 

I'd say this differently: SCHED_RR is available to share the CPU evenly
between FIFO threads which belong to the same priority group. So this
won't limit the CPU time consumed by a high-priority thread with respect
to low priority threads, the former would keep running indefinitely
until it blocks, or there is a runnable thread with equal or higher
priority.

The equivalent for SCHED_RR in the native skin is implemented by
rt_task_slice().

An option to actually cap the execution time of a thread at a certain
priority level would be to use the sporadic server scheduling
(SCHED_SPORADIC). When the time limit is reached, the thread priority is
lowered, until some conditions are met to switch it back to normal
priority. Both Xenomai 2.x and 3.x implement this
(pthread_setschedparam_ex()).

In addition, Xenomai 3 implements the SCHED_QUOTA policy, which assigns
user-defined percentages of the available CPU time to thread groups,
within a given period of time. The execution time of a thread is charged
to the group it belongs to, until the quota is exceeded, at which point
all threads from that group are de-scheduled, until the next period
starts. And so on.

-- 
Philippe.


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-02-04  8:37 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-02-03 23:46 [Xenomai] Setting execution time limit of task? Steve B
2015-02-04  8:37 ` Philippe Gerum

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.