I don't believe preventing starvation was the reason why put is a task. I think that the main reason was for symmetry with the put/get methods of mailboxes. A mailbox's put method is a task since a bounded mailbox may cause put to block. Arturo -----Original Message----- From: owner-sv-ec@eda.org [mailto:owner-sv-ec@eda.org] On Behalf Of Steven Sharp Sent: Monday, October 03, 2005 1:53 PM To: sv-ec@eda.org; jamiel@Model.com Subject: RE: [sv-ec] Eratta: Semaphore put method should be a function, not a task >From: "LaFlamme, Jamie" <jamiel@model.com> >Are you sure that put() should never block? The LRM isn't specific, but >one reasonable implementation would be for put() to execute threads >blocked on a get() before put() returns. That would reduce the risk of >thread starvation. Having the scheduler suspend a thread is not the same thing as the thread blocking. A Verilog scheduler is allowed to suspend a thread pretty much any time it wants to, including within a function call, even though a function call is not allowed to block. Since the scheduler can suspend a thread in a function call at any statement, it can certainly suspend it at a put() if it likes. Steven Sharp sharp@cadence.comReceived on Mon Oct 3 15:42:01 2005
This archive was generated by hypermail 2.1.8 : Mon Oct 03 2005 - 15:42:42 PDT