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=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,534dd301375921ac X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.68.193.129 with SMTP id ho1mr3641831pbc.8.1339707107940; Thu, 14 Jun 2012 13:51:47 -0700 (PDT) Path: l9ni51159pbj.0!nntp.google.com!news1.google.com!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail From: awdorrin Newsgroups: comp.lang.ada Subject: Re: Is Text_IO.Put_Line() thread-safe? Date: Thu, 14 Jun 2012 13:50:21 -0700 (PDT) Organization: http://groups.google.com Message-ID: <3fff1269-06f5-47a2-bc10-c2145b3a297d@googlegroups.com> References: <93201f1a-d668-485e-83b4-492bc283f36e@googlegroups.com> NNTP-Posting-Host: 192.91.173.42 Mime-Version: 1.0 X-Trace: posting.google.com 1339707107 16701 127.0.0.1 (14 Jun 2012 20:51:47 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Thu, 14 Jun 2012 20:51:47 +0000 (UTC) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=192.91.173.42; posting-account=YkFdLgoAAADpWnfCBA6ZXMWTz2zHNd0j User-Agent: G2/1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Date: 2012-06-14T13:50:21-07:00 List-Id: On Thursday, June 14, 2012 2:56:05 PM UTC-4, Jeffrey Carter wrote: > This design sounds suspect to me. Everything in Common needs to be protec= ted if=20 > it's being accessed by multiple tasks. The design is incredibly bad, in my opinion. This is 25 year old code, orig= inally written in Ada83 for an AIX RISC system. The original application wa= s multiple AIX processes. This code was then ported to VxWorks and the proc= esses were made VxWorks tasks. Now I've been given the task of porting the application from VxWorks to Lin= ux. Considering it is nearly 300k SLOC of Ada and C (written for Big Endian= RISC/Motorola) the port has been pretty successful so far. > > > > Text_IO.Put_Line( Proc_Enum'Image(thisPID)&" waiting for"& > > Proc_Enum'Image(waitPID)); >=20 > Is this in Common, or in the tasks that use Common? >=20 The procedure that contains the 'Rendezvous_With_Others' procedure is locat= ed in the common package, which is then 'With'd into every other thread. Co= mmon has both Ada and C interfaces to the same functions/procedures. One th= read is the 'Control' thread, while the others wait for it, but they are al= l calling the Rendezvous_With_Others procedure, passing in their ID. It is a mess, and if I could re-design the whole thing, I would. Unfortunat= ely I'm being told 'make it work' and that since the application has been u= sed for 25+ years on the other platforms that there isn't anything wrong wi= th the design.