comp.lang.ada
 help / color / mirror / Atom feed
From: madmats@elcgl.epfl.ch
Subject: Re: Hiding Concurrency
Date: 19 Apr 91 02:11:48 GMT	[thread overview]
Message-ID: <1991Apr19.031148.1@elcgl.epfl.ch> (raw)
In-Reply-To: jls.671951147@rutabaga

In article <jls.671951147@rutabaga>, jls@rutabaga.Rational.COM (Jim Showalter) writes:
> Why did you use semaphores instead of tasking for this problem?
> If you had used tasking, your concurrency problems would have
> gone away--that is, after all, what tasking is FOR.

Because tasks can only be accessed through entries, and composite ADTs often
require iterators (implemented as generic procedures in non-concurrent ADTs).

For instance, try to convert this to a concurrent ADT without using semaphores:

generic
   type Item_Type is private;
   with function "<" (Left, Right : Item_Type) return Boolean is <>;
package Sets is

   type Set is limited private;

   procedure Insert (Item : in Item_Type;
                     Into : in out Set);

   procedure Remove (Item : in Item_Type;
                     From : in out Set);

   generic
      with procedure Action (Item : in Item_Type);
   procedure Enumerate (The_Set : in Set);

end Sets;

You will have much trouble specifying Enumerate as a task entry (not to
speak of implementation, as Enumerate will be recursive if the Sets
are implemented as binary trees).

Mats

  reply	other threads:[~1991-04-19  2:11 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1991-04-15 21:13 Hiding Concurrency Steven J. Zeil
1991-04-16 15:28 ` madmats
1991-04-18  5:05 ` Jim Showalter
1991-04-19  2:11   ` madmats [this message]
     [not found] <671951147@<jls>
1991-04-21 21:09 ` stt
replies disabled

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