comp.lang.ada
 help / color / mirror / Atom feed
From: Mats Weber <Mats.Weber@elca-matrix.ch>
Subject: Re: Streams and Concurrency
Date: 1999/01/08
Date: 1999-01-08T00:00:00+00:00	[thread overview]
Message-ID: <36962E36.BA1A61B0@elca-matrix.ch> (raw)
In-Reply-To: 76g91o$udt$1@nnrp1.dejanews.com

dewar@gnat.com wrote:

> In any case, GNAT guarantees that blocking operations CAN
> be done within protected objects, of course you may get
> deadlock if you do obviously bad things, but certainly
> doing IO within a protected object is not such a bad thing,
> and this will work fine. We have many customers who depend
> on this guarantee.

I agree totally.

> Yes, yes, of course this is potentially non-portable, but
> it makes protected objects enormously more useful. Remember
> that there are two advantages of protected objects:
> 
> 1) possibility of more efficient implementation (I say
> possibility here because in fact there are many
> complications which result in less efficiency than you
> might have hoped for in the general case, and in any
> case some cases of agent tasks can be optimized in a
> corresponding efficient manner.

Are you talking about what DEC Ada and Verdix call passive tasks ?

> 2) preferable abstraction to a task in some situations
> 
> For my taste 2) is much more important than 1), and the
> restriction on blocking operations badly damages the use
> of 2).

I also see other reasons:

3) In order to protect objects with potentially blocking operations (a
socket, a pipe, etc.), you must either use a semaphore implemented as a
protected object and call the semaphore _twice_, once for locking and
once for unlocking, or you must use a task. Thus the promised
performance gain with protected objects is lost.

4) It is another case where the standard enforces things that no
compiler can check, neither at compile time nor at run time. Ada 83 had
incorrect order dependences in this category, where it was allowed to
raise Program_Error if it found one. Fortunately, this was removed from
Ada 95 and I think the restriction on blocking protected operations
falls in the same category.




  parent reply	other threads:[~1999-01-08  0:00 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-12-30  0:00 Streams and Concurrency James S. Rogers
1998-12-29  0:00 ` David Botton
1998-12-30  0:00   ` James S. Rogers
1998-12-30  0:00     ` dennison
1998-12-30  0:00       ` James S. Rogers
1999-01-04  0:00       ` Robert I. Eachus
1998-12-31  0:00     ` Jean-Pierre Rosen
1998-12-31  0:00       ` dewar
1998-12-31  0:00         ` dennison
1999-01-04  0:00         ` Jean-Pierre Rosen
1999-01-04  0:00           ` robert_dewar
1998-12-31  0:00       ` dewar
1998-12-31  0:00         ` Ada-G, was " Tom Moran
1999-01-01  0:00           ` Brian Rogoff
1999-01-04  0:00             ` Robert I. Eachus
1999-01-08  0:00               ` Mats Weber
1999-01-08  0:00                 ` Robert I. Eachus
1999-01-01  0:00           ` dewar
1999-01-01  0:00             ` Larry Kilgallen
1999-01-08  0:00         ` Mats Weber [this message]
1999-01-08  0:00           ` Tucker Taft
1998-12-30  0:00   ` dennison
1998-12-30  0:00     ` Tucker Taft
1998-12-30  0:00       ` dennison
1998-12-31  0:00         ` robert_dewar
1998-12-30  0:00       ` Robert I. Eachus
1998-12-30  0:00         ` Tucker Taft
1998-12-31  0:00         ` dennison
1998-12-31  0:00           ` robert_dewar
1998-12-31  0:00             ` dennison
1999-01-01  0:00               ` robert_dewar
1999-01-04  0:00           ` Robert I. Eachus
1998-12-30  0:00 ` dennison
1998-12-30  0:00   ` Robert I. Eachus
1999-01-11  0:00   ` Bulk synchronous model for IO (was Re: Streams and Concurrency) Kevin Rigotti
replies disabled

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