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=-2.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, MAILING_LIST_MULTI autolearn=unavailable autolearn_force=no version=3.4.4 X-Google-Thread: 103376,c3c4ae45442f569e X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII Path: g2news1.google.com!news4.google.com!news2.google.com!proxad.net!freenix!news.enst.fr!melchior!cuivre.fr.eu.org!melchior.frmug.org!not-for-mail From: =?ISO-8859-1?Q?Bj=F6rn_Lundin?= Newsgroups: comp.lang.ada Subject: Re: Ada.Text_IO and protected objects (Was: [newbie question] tasks and protected types) Date: Fri, 29 Apr 2005 17:23:11 +0200 Organization: Cuivre, Argent, Or Message-ID: References: <1114747457.868019.93210@f14g2000cwb.googlegroups.com> <42720DCD.6030304@mailinator.com> <4272260d$0$30463$ba620e4c@news.skynet.be> NNTP-Posting-Host: lovelace.ada-france.org Mime-Version: 1.0 (Apple Message framework v622) Content-Type: multipart/alternative; boundary=Apple-Mail-1--957962103 X-Trace: melchior.cuivre.fr.eu.org 1114788218 9896 212.85.156.195 (29 Apr 2005 15:23:38 GMT) X-Complaints-To: usenet@melchior.cuivre.fr.eu.org NNTP-Posting-Date: Fri, 29 Apr 2005 15:23:38 +0000 (UTC) Cc: comp.lang.ada@ada-france.org To: Jacob Sparre Andersen Return-Path: In-Reply-To: X-Mailer: Apple Mail (2.622) X-Virus-Scanned: by amavisd-new at spray.net X-Virus-Scanned: by amavisd-new-20030616-p10 (Debian) at ada-france.org X-BeenThere: comp.lang.ada@ada-france.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Gateway to the comp.lang.ada Usenet newsgroup" List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Xref: g2news1.google.com comp.lang.ada:10823 Date: 2005-04-29T17:23:11+02:00 --Apple-Mail-1--957962103 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=ISO-8859-1; delsp=yes; format=flowed 2005-04-29 kl. 14.45 skrev Jacob Sparre Andersen: > Adrien Plisson wrote: >> Jacob Sparre Andersen wrote: > >>> If calls to Ada.Text_IO _are_ potentially blocking operations, >>> that means that one has to move the calls to a task. >> >> and what about putting them into an entry of a protected object? > > I think I need an explanation of the difference between entries and > procedures of protected objects. Any suggestion of some reading > materials? > Ada As A Second Language by Norman Cohen Has a nice and long chapter about protected objects and tasking As a remark to the issue of text_io being potentially blocking, I've =20 developed code that works as it should with Windows and gnat, but came to a total =20 freeze of the process when compiled with Object Ada. The freeze occured when calling text_io =20= inside a protected procedure. Replacing the protected object with another task solved it. In the book above, the author mentions that io inside protected objects =20= will either freeze the process, or work, but with the protection disabled, or work very well? Anyway, I =20= will always be carefull with protected objects in the future. /Bj=F6rn Bj=F6rn Lundin bnl at spray dot se --Apple-Mail-1--957962103 Content-Transfer-Encoding: quoted-printable Content-Type: text/enriched; charset=ISO-8859-1 2005-04-29 kl. 14.45 skrev Jacob Sparre Andersen: Adrien Plisson wrote: Jacob Sparre Andersen wrote: If calls to Ada.Text_IO _are_ potentially blocking operations, that means that one has to move the calls to a task. and what about putting them into an entry of a protected object? I think I need an explanation of the difference between entries and procedures of protected objects. Any suggestion of some reading materials? Arial = Ada= As A = Second = Language by Norman Cohen = < Has a nice and long chapter about protected objects and tasking As a remark to the issue of text_io being potentially blocking, I've developed code that works as it should with Windows and gnat, but came to a total freeze of the process when compiled with Object Ada. The freeze occured when calling text_io inside a protected procedure. Replacing the protected object with another task solved it. In the book above, the author mentions that io inside protected objects will either freeze the process,=20 or work, but with the protection disabled, or work very well? Anyway, I will always be carefull with protected objects in the future. /Bj=F6rn Bj=F6rn Lundin bnl at spray dot se --Apple-Mail-1--957962103--