RE: [sv-ec] When does the mailbox put task block

From: Rich, Dave <Dave_Rich_at_.....>
Date: Wed Nov 09 2005 - 08:10:17 PST
Chris,

There was a similar discussion about semaphores two months back. You have to guarantee true FIFO ordering, so that if some other thread was already waiting to do a put, they have to be serviced first.

Dave


> -----Original Message-----
> From: owner-sv-ec@eda.org [mailto:owner-sv-ec@eda.org] On Behalf Of Chris
> Spear
> Sent: Wednesday, November 09, 2005 3:30 AM
> To: sv-ec@eda.org
> Subject: [sv-ec] When does the mailbox put task block
> 
> When does a mailbox put() block?  According to the LRM:
> 
> 	"If the mailbox was created with a bounded queue the process
> 	shall be suspended until there is enough room in the queue."
> 
> These seems ambigious to me.  Does the message get placed into the queue
> then the process is blocked?
> 
> If I create a mailbox with a size of 1, does the first put() block, or the
> second?
> 
> Can a mailbox be configured so that the source produces one message, does
> a put() which blocks immediately until the drain removes it with a get()?
> This does not seem likely.
> 
> Here is my interpretation:
> 
> If the mailbox was created with a bounded queue, put() will check if the
> queue is full.  If the queue is not full, put() shall place the message in
> the queue and return immediately.  If the queue is full, the put shall
> block until the queue becomes non-full, at which point it shall place the
> message into the queue and return."
> 
> /*********************************************************
> Chris Spear              Verification Specialist
> Synopsys, Inc.           Phone 508-263-8114      ..  __@
> 377 Simarano Drive       Fax   508-263-8123        _`\<,_
> Marlboro, MA 01752 USA   Cell  508-254-7223    .. (*)/ (*)
> Spear_ f rom _Synopsys.com       http://Chris.Spear.net
> *********************************************************/
> 
Received on Wed Nov 9 08:10:20 2005

This archive was generated by hypermail 2.1.8 : Wed Nov 09 2005 - 08:10:25 PST