Thomas Fletcher
|
Re: LIFO Scheduling of server threads
|
Thomas Fletcher
03/16/2008 8:06 PM
post5848
|
Re: LIFO Scheduling of server threads
On Sat, Mar 15, 2008 at 12:41 PM, Thomas Wölfer <twoelfer@dspace.de> wrote:
> In your example two threads send messages with different prios to a
> server. The messages are queued and the order of receiving them depends on
> their prio.
>
> The way how I understand the System Architecture guide is that thread A,
> scheduling policy FIFO, prio n is busy and doing some work. Meanwhile thread
> B, scheduling policy FIFO, prio n is receive blocked.
> Now an interrupt comes in, delivering its message to thread B. Normally I
> would assume that thread B is inserted at the end of the ready queue for
> prio n and thread A continue its work. When thread A is blocked again thread
> B begins its work.
Yes, in the case of an event coming from an interrupt handler (or
implicitely via InterruptAttachEvent()), then when B
transitions from RECEIVE --> READY it will be placed at the end of the queue
for priority 'n'.
> But regading the System Architecture guide thread B, coming out of the
> receive blocked state is inserted at the HEAD of the ready queue and
> theirfore preempts thread A.
This is only true in the case where a client application is sending a
message to a server (via MsgSend()). It is done
to more closely mimic the semantics of a monolithic kernel call where making
a call to a kernel service, does not
cause a scheduling operation.
Since servers generally inherit the priority of the sending thread (unless
the channel is explicitely created such that
the priority is not inherited) this isn't an issue. The fact that you would
like you servers to use FIFO scheduling is
a bit different, but presumably your system design is doing that for a
reason.
Hope that this helps,
Thomas
|
|
|