Re: L4_ThreadSwitch behaviour

Espen Skoglund <[email protected]>
Newsgroups gmane.comp.micro-kernel.l4.l4ka.general
Message-ID <[email protected]>
[Martin Christian]
> My question is related to both L4Ka::Pistachio and
> NICTA::Pistachio-embedded, thus I'm mailing to both lists.

> Consider the following test cases:

> Case A
> ======
> 1. The root thread creates a new thread in a new address space (AS):
> 2. The root thread "refills" it's time slice (maybe that's bogus, but it
> is meant to ensure a full time slice is donated): L4_Yield();
> 3. The root thread donates the rest of it's time slice to the new
> thread:
>    L4_ThreadSwitch( ping_tid );

> Case B
> ======
> 1. The root thread creates a new thread in a new AS
> 2. The root thread waits for a startup IPC from the new thread (of
> course, the new thread has to be altered to send such an IPC)
> 3. The root thread "refills" it's time slice
> 4. The root thread donates the rest of it's time slice to the new thread

> Problem:
> Case A won't work, but Case B does. For Case A the new thread won't run,
> even though it's active and in the ready queue. The only difference is
> that in Case B the pages which hold the code are already mapped in the
> new threads AS.

A bit late for me to jump in, but I'll do it anyway.

As you've already been told, doing scheduling purely based on
timeslice donation is not a very good idea.  Even if you manage to
donate almost a complete timeslice there is no telling how much of the
timeslice you'll manage to consume due to interrupts, exception
handling, etc.

In your case I suspect that handling the page faults in the new thread
will consume quite a bit of your timeslice.

	eSk
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.