From: Ted Dennison <dennison@telepath.com>
Subject: Re: Controlled types for resource locking
Date: 1999/09/09
Date: 1999-09-09T00:00:00+00:00 [thread overview]
Message-ID: <7r8i8q$fpg$1@nnrp1.deja.com> (raw)
In-Reply-To: iMAB3.157$QV.27052@typhoon-sf.pbi.net
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?
--
T.E.D.
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
next prev parent 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 ` David C. Hoos, Sr.
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 [this message]
1999-09-09 0:00 ` Tucker Taft
1999-09-08 0:00 ` Matthew Heaney
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox