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!212.101.4.254.MISMATCH!solnet.ch!solnet.ch!newsfeed01.sul.t-online.de!t-online.de!feed.news.tiscali.de!darth-vader.mobilixnet.dk!newsfeed.orangenet.dk!news.hacking.dk!pnx.dk!not-for-mail From: Jacob Sparre Andersen Newsgroups: comp.lang.ada Subject: Re: Ada.Text_IO and protected objects Date: 02 May 2005 16:10:52 +0200 Organization: hacking.dk - Doing fun stuff with open source Sender: sparre@hugin.crs4.it Message-ID: References: <1114747457.868019.93210@f14g2000cwb.googlegroups.com> <42720DCD.6030304@mailinator.com> <4272260d$0$30463$ba620e4c@news.skynet.be> <1114811841.250745.71870@o13g2000cwo.googlegroups.com> <1s8wkzten2pnf.p7sbzkiszqsd.dlg@40tude.net> <1115030470.407204.24590@g14g2000cwa.googlegroups.com> NNTP-Posting-Host: hugin.crs4.it Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: xyzzy.adsl.dk 1115043293 19545 156.148.71.67 (2 May 2005 14:14:53 GMT) X-Complaints-To: usenet@news.hacking.dk NNTP-Posting-Date: Mon, 2 May 2005 14:14:53 +0000 (UTC) User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.4 Xref: g2news1.google.com comp.lang.ada:10871 Date: 2005-05-02T16:10:52+02:00 List-Id: Fabio de Francesco wrote: > Thank all of you. I have thought a while about the need to start a > third task to do the actual writing to Standard_Output as the second > variant mentions. I decided not to do it because the original > problem is to manage two different printer devices or output files, > one at each door. If you write to two _different_ files in the two different tasks, then you're safe, but that was not what you were doing. > Otherwise there wouldn't be any need two have two different tasks to > emit tickets, only one would suffice. (I hope I am not missing > something...) What the two tasks in youre examle are doing, is: logging that the protected object issues tickets to them - to a _common_ log. > Anyway just to reason on the solution Dmitry and Jacob suggest, how > would you implement that one? If I have understood there would be > the need for a third task in charge to handle IO. I suppose it means > that the other two tasks have to emit "tickets" to a protected queue > that would be later read by the third task in order to print > them. Is it what you mean? How can we assure that all elements in > queue are ordered by increasing numbers if any of the previous two > tasks add tickets to this queue at random times? I think there must > be something I didn't catch. I am not even sure you were proposing a > queue working in terms I explained here. Can you make your solution > clearer for me, please? Your original specification (if one can say there was any) didn't say anything about having to log the issued tickets in sequence. Please give us a more exact description of what you want to do, before we start making speculative experiments based on more or less wild guesses. Jacob -- "War does not determine who is right - only who is left." -- Bertrand Russell