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-Thread: 103376,c3c4ae45442f569e X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!proxad.net!news.tele.dk!news.tele.dk!small.news.tele.dk!uninett.no!news.banetele.no!news.hacking.dk!pnx.dk!not-for-mail From: Jacob Sparre Andersen Newsgroups: comp.lang.ada Subject: Re: tasks and protected types Date: 29 Apr 2005 13:33:25 +0200 Organization: hacking.dk - Doing fun stuff with open source Message-ID: References: <1114747457.868019.93210@f14g2000cwb.googlegroups.com> <1114771627.401153.78280@z14g2000cwz.googlegroups.com> NNTP-Posting-Host: 80.241.165.42 Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: xyzzy.adsl.dk 1114774815 3700 80.241.165.42 (29 Apr 2005 11:40:15 GMT) X-Complaints-To: usenet@news.hacking.dk NNTP-Posting-Date: Fri, 29 Apr 2005 11:40:15 +0000 (UTC) User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.4 Xref: g2news1.google.com comp.lang.ada:10813 Date: 2005-04-29T13:33:25+02:00 List-Id: Fabio de Francesco wrote: > Jacob Sparre Andersen wrote: > > Fabio de Francesco wrote: > > And then I also prefer to keep the printing to a single protected > > object. > > Why? Could lines come out intermixed? Does it mean that it is always > needed to protect every call to library functions and procedures? Do > they use global variables? They modify the global variable "Ada.Text_IO.Standard_Output". > Why an error in using strings makes the program to behave as it was > a deadlock? Exceptions in tasks is un(?)fortunately not something I really understand. I don't think that it matters that it is something with strings. I think putting a "raise Some_Exception;" in the accept block would give the same result. If you will accept a guess: An exception is raised in the first accept call. This means that the D1 task terminates (they do that, when you have exceptions), but without finishing the accept block. This leaves Manage hanging, waiting for D1 (which is dead) to finish its accept block. Greetings, Jacob -- "Three can keep a secret if two of them are dead."