AW: L4_ThreadSwitch behaviour

"Christian, Martin, OPEE45" <[email protected]>
Newsgroups gmane.comp.micro-kernel.l4.l4ka.general
Message-ID <[email protected]>
Hi Ben!
Now it's working! :-) I've changed two things:
a) I'm using a loop for time slice donation
b) I'm setting the prioriy of the Pager to 0xff (the same as roottask)

I assume after the Pagefault IPC was created, the Scheduler is run to select the next runnable thread - which is roottask. Thus the Pager is never executed.

But that seems unfair to me! Ping thread got donated a time slice but can't ever use it. Just because it creates a Pagfault at startup and thus sending an IPC is required, which in turn triggers the scheduler. But I suppose, that's life ... :-/

Cheers,

Martin.

-----Ursprüngliche Nachricht-----
Von: Ben Leslie [mailto:[email protected]] 
Gesendet: Donnerstag, 15. Februar 2007 21:53
An: Christian, Martin, OPEE45
Cc: [email protected]; [email protected]
Betreff: Re: L4_ThreadSwitch behaviour

On Thu Feb 15, 2007 at 17:27:41 +0100, Christian, Martin, OPEE45 wrote:
>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):
>   L4_ThreadControl( ping_tid, ping_tid, master_tid, L4_nilthread,
>                     L4_anythread, L4_anythread, NOUTCB )
>   L4_SpaceControl( ping_tid, 0, kip_area, utcb_area, &control )
>   L4_ThreadControl( ping_tid, ping_tid, master_tid, pager_tid,
>                     L4_anythread, L4_anythread, UTCB(0) )
>   L4_Start( ping_tid, (L4_Word_t)ping_stack + sizeof(ping_stack) - 32,
>             START_ADDR(testing_thread) )
>
>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.
>
>I think this is a generic issue, however I'm working with a "homemade"
>PowerPC Version of NICTA::Pistachio-embedded based on the Karlsruhe
>version.
>
>Questions:
>1.) Why does Case A fail (or at least don't do anything)?
>2.) Is there are difference between the semantics used in
>L4Ka::Pistachio and NICTA::Pistachio-embedded (or between X2 and N1)?
>
>Any opinions, experiences, fairy tales would be appreciated! :-)

OK, some guesses:

1/ What are the relative priorities of the thread in both cases?

2/ What is the pager doing in case A?

3/ What is the exact state of ping thread in case A (e.g: break into kdb
and dump thread state)

Cheers,

Benno
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.