[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Concurrency, Exceptions and Poison

Peter wrote:
> BUT ... it really screws up some basic algebraic laws!  For example:
>                P       =       PAR          =       PAR
>                                  P                    SKIP
>                                  SKIP                 P
> where the = means semantic equivalence.  But, on the LHS, P's 
> exception is
> thrown.  On the middle/RHS, it isn't!  So, with exceptions, 
> that law no longer
> holds :-( ...

It seems to me that the discrepancy is resolved if PAR were to handle
exceptions of subprocesses the same way the OS does.  Ie if poisoning
P causes the OS to print a message for the LHS, it should also cause
the same behavior in PAR (perhaps delayed until sub processes terminate).

> The good thing about this is that it gives us a safe way of 
> freezing processes
> temporarilly or permanently.  The bad thing is that, in the 
> latter case, it
> doesn't permit any tidy-up actions (that involve further 
> synchronisation).

I think the way out of this dilemma is to view all processes as 
having a default handler.  If you need tidy-up operations,
replace the default handler with explicite code. (Or, if you're 
a stickler for WYSIWYG, require all processes to explicitly
handle poison.  Personally, I like the former)

What do you think?