Re: [sv-bc] Can a function contain a fork/join/any/none?

From: Steven Sharp <sharp_at_.....>
Date: Tue Feb 21 2006 - 17:42:12 PST
>Non-member submission from Kevin Cameron

>The problem is that a function is a dynamic context, if the threads of
>the
>fork access the context (stack frame) of the function the function
>cannot
>complete until the fork completes (even if it's a join-none). Analysing
>the usage is non-trivial so it's better (IMO) to disallow the fork.

Except that in the similar situation of automatic tasks and blocks
declaring automatic variables, the standard has already specified
that the task or block does "complete", as in execution exiting the
block.  This despite the fact that the lifetime of the context or
stack frame ends up extending beyond the point where the process
creating it has exited it.  This means that the dynamic context isn't
really a stack frame and these aren't really automatic variables in
the C sense.  I find it really ugly, but that is how it is defined.

So this does not prevent a function from returning in zero time, even
if there are subprocesses still accessing variables in the function
scope when it does.  So this is not a problem that prevents functions
from containing fork/join_none, even if the fork/join_none is allowed
to consume time.

Steven Sharp
sharp@cadence.com
Received on Tue Feb 21 17:42:18 2006

This archive was generated by hypermail 2.1.8 : Tue Feb 21 2006 - 17:43:46 PST