comp.lang.ada
 help / color / mirror / Atom feed
From: Tucker Taft <stt@averstar.com>
Subject: Re: Controlled types for resource locking
Date: 1999/09/09
Date: 1999-09-09T00:00:00+00:00	[thread overview]
Message-ID: <37D7E247.9B3C9FC0@averstar.com> (raw)
In-Reply-To: 7r8i8q$fpg$1@nnrp1.deja.com

Ted Dennison wrote:
> 
> In article <iMAB3.157$QV.27052@typhoon-sf.pbi.net>,
>   tmoran@bix.com wrote:
> > >I have some code in which I'm protecting a hardware resource using a
> > >protected type. It's getting quite a mess at the moment with
> lock/unlocks
> > >all over the place - especially where exception handlers get
> involved. I'm
> >   You can make a controlled type whose Initialize grabs the lock and
> > whose Finalize releases it, then declare an object of this controlled
> > type as the first thing in any subprogram (or block) that needs access
> > to the hardware.  Thus you can't execute code inside the subprogram
> 
> Interesting. In effect you are creating an object just for its side
> effects. But if that's all you ever do with the object, wouldn't it be
> in danger of being optimized away by the compiler? Or are compilers not
> allowed to do that with controlled objects?

Limited controlled objects may not be optimized away.
There is an AI being debated that would formalize this further,
and probably disallow optimizing away non-limited controlled objects
when there is a user-defined Initialize procedure.
> 
> --
> T.E.D.
> 
> Sent via Deja.com http://www.deja.com/
> Share what you know. Learn what you don't.

-- 
-Tucker Taft   stt@averstar.com   http://www.averstar.com/~stt/
Technical Director, Distributed IT Solutions  (www.averstar.com/tools)
AverStar (formerly Intermetrics, Inc.)   Burlington, MA  USA




  reply	other threads:[~1999-09-09  0:00 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-09-08  0:00 Controlled types for resource locking Steve Folly
1999-09-08  0:00 ` tmoran
1999-09-09  0:00   ` Pat Rogers
1999-09-09  0:00     ` Matthew Heaney
1999-09-09  0:00       ` Pat Rogers
1999-09-09  0:00         ` Matthew Heaney
1999-09-09  0:00           ` Pat Rogers
1999-09-09  0:00   ` Ted Dennison
1999-09-09  0:00     ` Tucker Taft [this message]
1999-09-08  0:00 ` Matthew Heaney
1999-09-08  0:00 ` David C. Hoos, Sr.
replies disabled

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