Default attributes of tasks/lthreads

Robert Kaiser rob at sysgo.de
Mon May 31 10:14:35 CEST 1999



On 29 May 1999, Michael Hohmuth wrote:

> Robert Kaiser <rob at sysgo.de> writes:
> 
> > I have a question regarding the default scheduling parameters
> > of newly created tasks and lthreads under L4:
> > 
> > When I create a new task with the task_new syscall, according
> > to the L4 manual, that task's lthread 0 starts running immediately.
> > 
> > But what are it's scheduling parameters (timeslice duration,
> > priority) in this case ?
> > 
> > Similarly, when I create a new lthread with lthread_ex_regs,
> > how are it's scheduling parameters determined ?
> 
> The parameters are inherited from the creating thread.
> 
> There usually is a way to change the parameters before the new thread
> starts running: Use the thread_schedule system call before serving the 
> thread's first page fault.
> 
> > Also, is it possible to set these parameters for an lthread
> > that does not yet exist (The manual doesn't explicitly state
> > this, but the fact that -conceptually- all lthreads of a task
> > always exist would suggest that this is indeed possible) ?
> 
> Good question.  I think this is not really defined in the manual.  The 
> current implementations don't support what you suggest; instead, the
> scheduling parameters are inherited from the creating thread once the
> new thread is ``really'' created.
> 
> Do you have an application where this behavior is a problem?
> 


The question came up while writing a test suite for a microkernel
we are currently developing. It's API is not identical, but quite
similar to L4's (we would like to run L4Linux on it in the future).

I can certainly handle this behavior, but I was just wondering
what would be a "clean" design. From what I just learned, there
is in fact a difference between a thread being created and a thread
being re-started into a new context: In the first case, the thread's
scheduling parameters are inherited from the caller, in the latter
case, they retain whatever values they had before. So the caller
of lthread_ex_regs has to be aware of wether the thread already
exists or not.

Rob

----------------------------------------------------------------
Robert Kaiser                          email: rkaiser at sysgo.de
SYSGO RTS GmbH
Carl-Zeiss-Str. 41                     phone: (49) 6131 9138-80
D-55129 Mainz / Germany                fax:   (49) 6131 9138-10





More information about the l4-hackers mailing list