Re: [tsc] Re: why zephyer os did not support RR-Schedule policy between same priority task?

Nashif, Anas

Moving this to the devel@ mailing list.

The relevant jira:


-----Original Message-----
From: Benjamin Walsh [mailto:benjamin.walsh(a)]
Sent: Friday, January 20, 2017 11:31 AM
To: 曹子龙 <13824125580(a)>
Cc: Nashif, Anas <anas.nashif(a)>; tsc(a)
Subject: Re: [tsc] Re: why zephyer os did not support RR-Schedule policy between same priority task?

i review the zephyr os core code about the schedule policy, and i
am not sure if it is right about what i said next, i found that
zephyr not support the the Round-Robin schedule policy which many
rtos adopted between two or more identical prio tasks, so i
thinks this may bring some trouble for application user ,because
they must know when and where to yield the cpu to another task
with same priority because the scheduler cant do that, am i right ?

appreciate your kindly help for my puzzle. :)
Look at

round robin is supported already with the following option:

bool "Thread time slicing"
default y
This option enables time slicing between preemptible threads of
equal priority.
but seems that the RR policy zephyr used, the time slice is
applied to the scheduler not each thread, is it? because i did
not see the time-slice member in the thread TCB block. and the
"_time_slice_duration" object is global but not thread private, am i

so the scheduler would be not thread evenly but force to schedule
without thought that whether it is the "current" thread cost up all
the time slice? because two thread with equal priority may release
cpu by volute yield operation, am i right?
That is correct: the time slicing is very coarse, and can be very unfair, depending when in the time slice the highest priority ready in the system changes. A thread can be preempted before it can execute a full time slice.

I personally don't like this policy. Changing it is one of the improvements that could be made to the kernel.

and ,by the way, did the zephyr has the plan to add the MMU support in
the future?
There have been some talks about this, and is something that will probably happen at some point. No plans yet though.


Benjamin Walsh, SMTS
WR VxWorks Virtualization Profile
Zephyr kernel maintainer

Join to automatically receive all group messages.