RE: [sv-ec] Re: [sv-bc] ballot comment on static reference arguments

From: Rich, Dave <Dave_Rich_at_.....>
Date: Fri Apr 08 2005 - 15:02:26 PDT
In general, static tasks are a problem for garbage collection, even with
out the ref argument. If I pass a class handle to an argument of a
static task/function, that static argument retains the handle after the
task/function returns.

If you just disallow hierarchical references to the static argument,
that doesn't change the fact that the argument still contains the
reference after the task exits (or you would have to add more language
that says that it doesn't).

So the simpler solution is to just forbid declaring a static task in
this case, which is the direction we want users to take anyway.

BTW, you can't  declare a static argument to an automatic task.

Dave



> -----Original Message-----
> From: owner-sv-bc@eda.org [mailto:owner-sv-bc@eda.org] On Behalf Of
Steven
> Sharp
> Sent: Friday, April 08, 2005 1:56 PM
> To: sv-bc@eda.org; Brad.Pierce@synopsys.com
> Cc: sv-ec@eda.org
> Subject: Re: [sv-ec] Re: [sv-bc] ballot comment on static reference
> arguments
> 
> 
> >I agree with you and suggested the same for this ballot issue (235)
> >during the SV-EC face-to-face.  Dave was of the opinion though that
> >there would still be a problem with dangling references.
> 
> I am not sure why that would be.
> 
> The most extreme case I can come up with is a static task containing
> fork/join_any.  The subprocesses could continue to access the ref
> argument after the task returns, so the reference must still be
> considered valid and prevent garbage collection.  If an implementation
> didn't want to have to keep track of whether there were any such
active
> subprocesses in a static task, a static ref formal would have to be
> treated as a valid reference until overwritten by another call.  That
> could defer garbage collection unnecessarily, but that would be an
> implementation choice not inherent in the language.
> 
> Since SV allows declaring static objects in automatic tasks, is it
> sufficient to forbid ref arguments in static tasks?  Is it possible to
> declare a ref argument formal to be static in an automatic task?
> 
> Steven Sharp
> sharp@cadence.com
Received on Fri Apr 8 15:02:50 2005

This archive was generated by hypermail 2.1.8 : Fri Apr 08 2005 - 15:02:58 PDT