Default POSIX thread attributes?

Vladimir Nesic vnesic at dkts.co.yu
Tue Feb 11 18:13:04 UTC 2003


On Tuesday 11 February 2003 17:41, gregory.menke at gsfc.nasa.gov wrote:
> Vladimir Nesic writes:
> ...
>
>  > 2) Default scheduler is SCHED_FIFO, which means that threads are
>  > started at sorpriseingly high priority.
>
> This is likely not a priority problem as its possibly a scheduling
> algorithm problem.  As I understand it, only root can create
> non-round robin scheduled tasks in Linux.  Under RTEMS, you can
> choose priority scheduling or round robin as you like.  Perhaps
> you're not being exhaustive enough in your pthread attribute
> initialization.

Yes, but SCHED_FIFO is highest priority scheduler that can be assigned
to pthread on RTEMS. Evenmore, thread executing under that scheduler
can be preempted only in case that it blocks.

Let's say that I made a mistake for not checking what is the default
priority, but it has seamed normal to me that default would be
relatively low priority, which can be raised if needed.

I must say that defalut high priority, which has to be lowered if not
needed doesnt seam logical to me :(

>  > 3) Scheduler and priority are inheritied by default, instead of
>  > set to default value, which ever default vaule is.
>
> We always use #ifdefs to create native RTEMS tasks on rtems or
> pthread tasks on Linux so we can take advantage of RTEMS when running
> on it. We never rely on Linux to provide specific realtime scheduling
> at this point.

Well, I was not expecting real time scheduling from posix. I am just
surprised that I have to check what is the priority of the current
thread every time I want to spawn a new one :(

Vlada



More information about the users mailing list