comp.lang.ada
 help / color / mirror / Atom feed
From: awdorrin <awdorrin@gmail.com>
Subject: Re: Is Text_IO.Put_Line() thread-safe?
Date: Thu, 14 Jun 2012 13:50:21 -0700 (PDT)
Date: 2012-06-14T13:50:21-07:00	[thread overview]
Message-ID: <3fff1269-06f5-47a2-bc10-c2145b3a297d@googlegroups.com> (raw)
In-Reply-To: <jrdc48$14h2$1@adenine.netfront.net>

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 protected if 
> it's being accessed by multiple tasks.

The design is incredibly bad, in my opinion. This is 25 year old code, originally written in Ada83 for an AIX RISC system. The original application was multiple AIX processes. This code was then ported to VxWorks and the processes were made VxWorks tasks.

Now I've been given the task of porting the application from VxWorks to Linux. 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));
> 
> Is this in Common, or in the tasks that use Common?
> 

The procedure that contains the 'Rendezvous_With_Others' procedure is located in the common package, which is then 'With'd into every other thread. Common has both Ada and C interfaces to the same functions/procedures. One thread is the 'Control' thread, while the others wait for it, but they are all 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. Unfortunately I'm being told 'make it work' and that since the application has been used for 25+ years on the other platforms that there isn't anything wrong with the design.





  reply	other threads:[~2012-06-14 20:51 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-14 12:53 Is Text_IO.Put_Line() thread-safe? awdorrin
2012-06-14 13:49 ` Robert A Duff
2012-06-14 14:35   ` Adam Beneschan
2012-06-14 14:38   ` Dmitry A. Kazakov
2012-06-14 14:56     ` J-P. Rosen
2012-06-14 16:01       ` Dmitry A. Kazakov
2012-06-14 18:34       ` Robert A Duff
2012-06-21 19:01         ` Randy Brukardt
2012-06-14 18:29     ` Robert A Duff
2012-06-21 19:04       ` Randy Brukardt
2012-06-14 21:14     ` tmoran
2012-06-14 14:42   ` awdorrin
2012-06-14 18:24     ` Robert A Duff
2012-06-14 20:37       ` awdorrin
2012-06-14 21:37         ` Robert A Duff
2012-06-15  5:32           ` Georg Bauhaus
2012-06-15  7:22             ` Dmitry A. Kazakov
2012-06-15 21:32               ` Robert A Duff
2012-06-16  7:41                 ` Dmitry A. Kazakov
2012-06-15 21:27             ` Robert A Duff
2012-06-14 18:56 ` Jeffrey Carter
2012-06-14 20:50   ` awdorrin [this message]
2012-06-14 21:41     ` Robert A Duff
2012-06-15 12:39       ` awdorrin
2012-06-14 22:17     ` Jeffrey Carter
2012-06-14 22:40       ` Simon Wright
2012-06-14 23:35         ` Jeffrey Carter
2012-06-15  5:04           ` Simon Wright
2012-06-15  5:41             ` Jeffrey Carter
2012-06-21 19:20             ` Randy Brukardt
2012-06-16  2:00       ` BrianG
2012-06-16  6:04         ` J-P. Rosen
2012-06-16  6:49           ` Simon Wright
2012-06-16  7:58             ` Dmitry A. Kazakov
2012-06-16  8:03               ` Simon Wright
2012-06-16  8:14                 ` Dmitry A. Kazakov
2012-06-21 19:27               ` Randy Brukardt
2012-06-16  7:51           ` Dmitry A. Kazakov
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox