Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: utzoo!mnetor!uunet!seismo!husc6!necntc!ames!ucbcad!ucbvax!SIERRA.STANFORD.EDU!Bryan
From: Bryan@SIERRA.STANFORD.EDU (Doug Bryan)
Newsgroups: comp.lang.ada
Subject: a tasking question for you
Message-ID: <12317696882.13.BRYAN@Sierra.Stanford.EDU>
Date: Sun, 12-Jul-87 02:49:51 EDT
Article-I.D.: Sierra.12317696882.13.BRYAN
Posted: Sun Jul 12 02:49:51 1987
Date-Received: Mon, 13-Jul-87 00:38:40 EDT
Sender: daemon@ucbvax.BERKELEY.EDU
Distribution: world
Organization: The ARPA Internet
Lines: 65


Dear Ada Fans,

After a long summer break, we're back with our pain-in-the-rear 
questions.  We have a nasty one about the semantics (or lack thereof) 
of RM 9.10(7).  Consider the following:

     with Text_Io;
     procedure Main is
        type Text is access String;

	task A;
	task B is
	  entry E (T : Text);
	end B;

	T : Text := new String'("xxxx");

	task body A is
	begin
	  B.E (T);
	exception
	  when Tasking_Error =>  Text_Io.Put_Line (T.all & T.all);
	end A;

	task body B is
	begin
	  accept E (T : Text) do
	    T.all := "yyyy";
	  end E;
	end B;
     begin
	abort B;
     end Main;

Is it possible for this program to print:

	xxxxyyyy

The following scenario seems possible (assuming a single
CPU system simplifies life):

	1. the rendezvous begins
	2. task B becomes abnormal (but not completed)
	3. Tasking_Error is raised in task A
	4. task A handles the exception
	5. the left-hand operand of "&" is evaluated (yielding "xxxx")
	6. task B executes the assignment statement 
	7. the right-hand operand of "&" is evaluated (yielding "yyyy")
	8. the Put_Line takes place

The wording in 9.10(7) seems not to preclude an abnormal task engaged
in a rendezvous from continuing execution AFTER the caller has received
and/or handled Tasking_Error.  If this is possible, then the called task
can still be mucking with actual parameters, while the calling task has
continued its own execution.  

If this is possible, we'll never use Ada again!  'C' doesn't have this
problem!! :-)

Bonus Question:  What does 9.10(8) have to do with the price of eggs?
	We don't understand how this could happen.

doug and geoff
-------