From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,3175c7276234c404 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-07-31 03:03:56 PST Path: archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!news-FFM2.ecrc.net!news.iks-jena.de!lutz From: lutz@iks-jena.de (Lutz Donnerhacke) Newsgroups: comp.lang.ada Subject: Re: Same two tasks in two rendezvous? Date: Tue, 31 Jul 2001 10:02:43 +0000 (UTC) Organization: IKS GmbH Jena Message-ID: References: NNTP-Posting-Host: taranis.iks-jena.de X-Trace: branwen.iks-jena.de 996573763 26311 217.17.192.37 (31 Jul 2001 10:02:43 GMT) X-Complaints-To: usenet@iks-jena.de NNTP-Posting-Date: Tue, 31 Jul 2001 10:02:43 +0000 (UTC) User-Agent: slrn/0.9.6.3 (Linux) Xref: archiver1.google.com comp.lang.ada:10854 Date: 2001-07-31T10:02:43+00:00 List-Id: * Adam Beneschan wrote: >Is it possible for two tasks, T1 and T2, to be in two rendezvous with >each other simultaneously? No. >Is this what should actually happen? Deadlock. >Is there anything in the language that prohibits this from happening? No, because it's possible to open the deadlock by a third task. with Ada.Text_IO; use Ada.Text_IO; procedure t is task type rev is entry e1; entry e2; end; task body rev is begin Put_Line ("Starting task"); accept e1 do Put_Line ("Entry E1"); accept e2 do Put_Line ("Entry E2"); end e2; end e1; Put_Line ("Stopping task"); end; e : rev; task type helper; task body helper is begin Put_Line ("Starting helper task"); e.e2; Put_Line ("Stopping helper task"); end helper; h : helper; -- comment this out to see what happens begin Put_Line ("First Rendevous"); e.e1; Put_Line ("Second Rendevous"); -- comment this out to see what happens e.e2; -- comment this out to see what happens Put_Line ("Stopping Main Task"); end t;