RE: [sv-ec] Strict FIFO ordering of mailboxes try_put/try_get

From: Rich, Dave <Dave_Rich_at_.....>
Date: Wed Feb 14 2007 - 11:33:17 PST
> >
> >Dave,
>
>Is there a big problem with the rule being that a try_get() succeeds if
and >only if BOTH the mailbox queue size is greater than 0 AND the queue
of >processes suspended on a blocking get has a size of 0?
>
>Mark


To answer Mark's earlier question, the big problem is that the current
LRM says that try_get() fails only if the mailbox is empty, or if the
semaphore does not have enough keys. That says to me that it is
pre-emptive. Of course, I'm interested in what the intent is and fixing
the LRM to match it.

But here another situation. Suppose I want to implement a flush or a
drain of a mailbox with

begin

	while (try_get(t));
		do_somthing_with(t); // do nothing for a flush
	ask_for_more(();
end


The ask_for_more() statement is under the assumption that mailbox has
been emptied. How can you ensure that the flush or drain executes unless
try_get is preemptive?

Dave


-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
Received on Wed Feb 14 11:33:37 2007

This archive was generated by hypermail 2.1.8 : Wed Feb 14 2007 - 11:33:47 PST