comp.lang.ada
 help / color / mirror / Atom feed
From: eachus@mitre-bedford.arpa  (Robert I. Eachus)
Subject: Re: re-use and concurrency
Date: 28 Aug 91 02:50:48 GMT	[thread overview]
Message-ID: <EACHUS.91Aug27195048@Dr_No.mitre.org> (raw)

In article <16575@encore.Encore.COM> jcallen@Encore.COM (Jerry Callen) writes:

   Seems to me the right way to solve this is with the library manager;
   put the "sequential" and "concurrent" implementations in separate libraries
   and them select the one you need at link time...

   What would REALLY be nice is to have the linker select the right library
   for you, based upon whether or not tasking is in use. Some linkers already
   know if tasking is present, so such automatic library selection SHOULDN'T
   be a difficult thing to offer, eh?

   Make anything you build as simple as possible...but not simpler.
Unfortunately software is NEVER simple, and when you care about
selecting components the choices have to be based on considerations
that no linker or library manager can be trusted with.  For example,
even in a tasking environment some resources will be managed by a
single task at any one time, so you want (and in a real-time
environment NEED) to use a sequential implementation.  Since it is
often the case in such systems that several tasks actually use the
package, a compiler can't figure it out without the design documents.
(For example, one task creates all the structures then starts up other
tasks which use them.  Happens all the time in real-time systems.)

   There is also a problem with your suggestion to select different
implementations at link time.  In many cases this is possible, and Ada
environments do support it.  However, in some cases the various
implementations must have different interfaces for the different
regimes.  Unfortunately, this happens all over the place with tasking.
For example, you often need to export the fact that a call is to a
task entry so that the user of the package can choose what type of
call to make.

   Another problem is more subtile: the interface may look the same
but you have to use it differently.  For example, a call to a
(tasking) queue when the queue is empty may not raise an exception, it
will just wait.  However, checking to see if the queue is empty before
making the call is no help.  In the sequential implementation, the
opposite is true.


--

					Robert I. Eachus

with STANDARD_DISCLAIMER;
use  STANDARD_DISCLAIMER;
function MESSAGE (TEXT: in CLEVER_IDEAS) return BETTER_IDEAS is...

             reply	other threads:[~1991-08-28  2:50 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1991-08-28  2:50 Robert I. Eachus [this message]
  -- strict thread matches above, loose matches on Subject: below --
1991-08-26 18:00 re-use and concurrency mintaka!ogicse!hsdndev!encore!jcallen
1991-08-17  4:37 Bob Kitzberger @midnight
1991-08-15 13:35 sdd.hp.com!spool.mu.edu!cs.umn.edu!sctc.com!stachour
1991-08-15  3:23 Jim Showalter
replies disabled

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