comp.lang.ada
 help / color / mirror / Atom feed
From: Darren New <dnew@san.rr.com>
Subject: Re: How to avoid unreferenced objects (mutexes etc)
Date: Thu, 17 Jan 2002 00:21:42 GMT
Date: 2002-01-17T00:21:42+00:00	[thread overview]
Message-ID: <3C4618E9.588010F8@san.rr.com> (raw)
In-Reply-To: u4c1f78s5gjd05@corp.supernews.com

Matthew Heaney wrote:
> Yes, it does, but you shouldn't bother using it.  Have the task wait on a
> guarded entry of a protected object, and communicate with the task by
> calling a protected procedure of the protected object.

I must admit that I'm not 100% clear on how this is better than a
selective accept, given that a selective accept allows me to time out
and to pick whichever entry is available first. I don't think I can pick
whichever protected object guard opens first, can I?

> Don't use selective accepts in tasks.  This is old-fashioned.  Rewrite your
> tasks to make blocking calls to an internal protected object.  Have
> operations communicate with the task by calling the protected object, which
> wakes up the waiting task.

Which is basically what I did. Except there were about 20 or 30 entry
points, with various combinations or acceptabilities - i.e., only some
operations made sense in some states. There was also a requirement to
wait for events from other sources (e.g., events from the UI or events
from the I/O framework). So I wound up with protected entries that
waited for this or that or the other, then told you which, which you
then called.... anyway, it was an awful mess compared to what it could
have been had I been able to have multiple task bodies defined for a
single task type.

But thanks for the advice. If I ever go back to developing this, I'll
rethink it again.

-- 
Darren New 
San Diego, CA, USA (PST). Cryptokeys on demand.
  The opposite of always is sometimes.
   The opposite of never is sometimes.



  reply	other threads:[~2002-01-17  0:21 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-01-11 13:48 How to avoid unreferenced objects (mutexes etc) Dmitry A. Kazakov
2002-01-11 13:52 ` Lutz Donnerhacke
2002-01-11 14:47 ` Robert A Duff
2002-01-11 18:02 ` Jeffrey Carter
2002-01-11 19:40 ` Robert Dewar
2002-01-12 10:18   ` Martin Dowie
2002-01-14  8:54   ` Dmitry A. Kazakov
2002-01-12  1:11 ` Nick Roberts
2002-01-12 22:04   ` Matthew Heaney
2002-01-13  5:45     ` Nick Roberts
2002-01-13  8:21       ` tmoran
2002-01-13 16:12         ` Nick Roberts
2002-01-13 15:08       ` Simon Wright
2002-01-15 17:53         ` Nick Roberts
2002-01-13 16:51       ` Jeffrey Carter
2002-01-14 23:32       ` Matthew Heaney
2002-01-15  8:53         ` Dmitry A. Kazakov
2002-01-14  8:31     ` Jean-Pierre Rosen
2002-01-14  9:42   ` Dmitry A. Kazakov
2002-01-15 15:41     ` Matthew Heaney
2002-01-15 16:18       ` Hyman Rosen
2002-01-15 16:57       ` Darren New
2002-01-15 18:57         ` Matthew Heaney
2002-01-16  0:57           ` Darren New
2002-01-16 16:35             ` Stephen Leake
2002-01-16 18:07               ` Darren New
2002-01-16 23:18                 ` Matthew Heaney
2002-01-16 23:04             ` Matthew Heaney
2002-01-17  0:21               ` Darren New [this message]
2002-01-16 15:18       ` Dmitry A. Kazakov
2002-01-15 18:59     ` Nick Roberts
2002-01-16 15:05       ` Dmitry A. Kazakov
2002-01-16 18:30         ` Matthew Heaney
2002-01-17  8:58           ` Dmitry A. Kazakov
2002-01-17  9:19             ` Lutz Donnerhacke
2002-01-17 10:42               ` Dmitry A. Kazakov
2002-01-17 10:55                 ` Lutz Donnerhacke
2002-01-17 15:30                   ` Dmitry A. Kazakov
2002-01-17 16:29                     ` Lutz Donnerhacke
2002-01-16 20:28         ` Robert A Duff
2002-01-17 19:05         ` Nick Roberts
replies disabled

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