comp.lang.ada
 help / color / mirror / Atom feed
* Entry Families
@ 2003-02-06  6:35 James S. Rogers
  2003-02-06  8:20 ` Dale Stanbrough
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: James S. Rogers @ 2003-02-06  6:35 UTC (permalink / raw)


Does anyone use entry families?
I find this language feature interesting, but I cannot see where
I would want to use it.

Jim Rogers





^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Entry Families
  2003-02-06  6:35 Entry Families James S. Rogers
@ 2003-02-06  8:20 ` Dale Stanbrough
  2003-02-06 19:03   ` Robert A Duff
  2003-02-06 18:28 ` Jeffrey Carter
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 8+ messages in thread
From: Dale Stanbrough @ 2003-02-06  8:20 UTC (permalink / raw)


In article 
<fnn0a.23050$rq4.1737814@bgtnsc05-news.ops.worldnet.att.net>,
 "James S. Rogers" <jimmaureenrogers@worldnet.att.net> wrote:

> Does anyone use entry families?
> I find this language feature interesting, but I cannot see where
> I would want to use it.
> 
> Jim Rogers


I never seen the use for them, apart from examples in Burns and Welling.
Even that may have been "Lets explain these features using a
contrived example". Perhaps the rationale for Ada95 may have some
explanation?

dale



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Entry Families
  2003-02-06  6:35 Entry Families James S. Rogers
  2003-02-06  8:20 ` Dale Stanbrough
@ 2003-02-06 18:28 ` Jeffrey Carter
  2003-02-07  3:49 ` Steve
  2003-02-07  8:44 ` Dmitry A. Kazakov
  3 siblings, 0 replies; 8+ messages in thread
From: Jeffrey Carter @ 2003-02-06 18:28 UTC (permalink / raw)


James S. Rogers wrote:
> Does anyone use entry families?
> I find this language feature interesting, but I cannot see where
> I would want to use it.

I've seen examples that use the feature, but never had a use for it myself.

-- 
Jeff Carter
"You've got the brain of a four-year-old boy,
and I bet he was glad to get rid of it."
Horse Feathers




^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Entry Families
  2003-02-06  8:20 ` Dale Stanbrough
@ 2003-02-06 19:03   ` Robert A Duff
  2003-02-06 20:34     ` James S. Rogers
  0 siblings, 1 reply; 8+ messages in thread
From: Robert A Duff @ 2003-02-06 19:03 UTC (permalink / raw)


Dale Stanbrough <dstanbro@bigpond.net.au> writes:

> In article 
> <fnn0a.23050$rq4.1737814@bgtnsc05-news.ops.worldnet.att.net>,
>  "James S. Rogers" <jimmaureenrogers@worldnet.att.net> wrote:
> 
> > Does anyone use entry families?
> > I find this language feature interesting, but I cannot see where
> > I would want to use it.

Preference control.  For example, if you want to refer to an entry
parameter in the barrier (which is illegal), and the parameter is
discrete (or you can produce a discrete value via some function),
then you can use an entry index instead.

> I never seen the use for them, apart from examples in Burns and Welling.
> Even that may have been "Lets explain these features using a
> contrived example". Perhaps the rationale for Ada95 may have some
> explanation?

Yes, the Rationale does have some (contrived) examples.

- Bob



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Entry Families
  2003-02-06 19:03   ` Robert A Duff
@ 2003-02-06 20:34     ` James S. Rogers
  2003-02-06 21:17       ` Robert A Duff
  0 siblings, 1 reply; 8+ messages in thread
From: James S. Rogers @ 2003-02-06 20:34 UTC (permalink / raw)


"Robert A Duff" <bobduff@shell01.TheWorld.com> wrote in message
news:wcc8ywtxmd9.fsf@shell01.TheWorld.com...
> Dale Stanbrough <dstanbro@bigpond.net.au> writes:
>
> > In article
> > <fnn0a.23050$rq4.1737814@bgtnsc05-news.ops.worldnet.att.net>,
> >  "James S. Rogers" <jimmaureenrogers@worldnet.att.net> wrote:
> >
> > > Does anyone use entry families?
> > > I find this language feature interesting, but I cannot see where
> > > I would want to use it.
>
> Preference control.  For example, if you want to refer to an entry
> parameter in the barrier (which is illegal), and the parameter is
> discrete (or you can produce a discrete value via some function),
> then you can use an entry index instead.
>
> > I never seen the use for them, apart from examples in Burns and Welling.
> > Even that may have been "Lets explain these features using a
> > contrived example". Perhaps the rationale for Ada95 may have some
> > explanation?
>
> Yes, the Rationale does have some (contrived) examples.

All the examples I have seen and considered have the effect of
serializing tasks. If I want serial behavior I do not need to develop
a set of tasks. Tasking is for developing concurrent behavior.

All members of a entry family act on the same protected object.
When I want to do something like a message router (as is shown
in one example in "Ada As A Second Language") I will create
an array or list of protected objects rather than a single protected
object with an entry family. This provides more potential concurrency
than using a single protected object. It is also a more flexible
design regarding the message routing "circuit" that I may want to
construct.

I wonder if entry families may be a feature that can be eliminated
in the next version of Ada.

Jim Rogers





^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Entry Families
  2003-02-06 20:34     ` James S. Rogers
@ 2003-02-06 21:17       ` Robert A Duff
  0 siblings, 0 replies; 8+ messages in thread
From: Robert A Duff @ 2003-02-06 21:17 UTC (permalink / raw)


"James S. Rogers" <jimmaureenrogers@worldnet.att.net> writes:

> All the examples I have seen and considered have the effect of
> serializing tasks.

That seems more like a property of protected objects, than entry
families.  If a protected object has just a single entry, and a bunch of
tasks call it, they are serialized.  Same thing if there are two
entries.  Same thing if there is a family of 1000 entries.

If there is a shared resource that *needs* that kind of serialization,
then an entry family can be used to control the order of service.

Requeue can be used for similar purposes.

> I wonder if entry families may be a feature that can be eliminated
> in the next version of Ada.

Not a chance.  I admit that entry families are not the most useful or
important feature of Ada.  But the ARG is not going to make incompatible
changes to Ada without good reason.  "Feature X does not seem all that
useful" is not a good enough reason.  Neither is, "I can think of a
better way than using feature X."

- Bob



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Entry Families
  2003-02-06  6:35 Entry Families James S. Rogers
  2003-02-06  8:20 ` Dale Stanbrough
  2003-02-06 18:28 ` Jeffrey Carter
@ 2003-02-07  3:49 ` Steve
  2003-02-07  8:44 ` Dmitry A. Kazakov
  3 siblings, 0 replies; 8+ messages in thread
From: Steve @ 2003-02-07  3:49 UTC (permalink / raw)


I have had one occasion to use the feature.
I can't remember the details, but do remember that it made the code a lot
simpler to essentially have an array of entries.

Steve
(The Duck)

"James S. Rogers" <jimmaureenrogers@worldnet.att.net> wrote in message
news:fnn0a.23050$rq4.1737814@bgtnsc05-news.ops.worldnet.att.net...
> Does anyone use entry families?
> I find this language feature interesting, but I cannot see where
> I would want to use it.
>
> Jim Rogers
>
>





^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Entry Families
  2003-02-06  6:35 Entry Families James S. Rogers
                   ` (2 preceding siblings ...)
  2003-02-07  3:49 ` Steve
@ 2003-02-07  8:44 ` Dmitry A. Kazakov
  3 siblings, 0 replies; 8+ messages in thread
From: Dmitry A. Kazakov @ 2003-02-07  8:44 UTC (permalink / raw)


On Thu, 06 Feb 2003 06:35:55 GMT, "James S. Rogers"
<jimmaureenrogers@worldnet.att.net> wrote:

>Does anyone use entry families?
>I find this language feature interesting, but I cannot see where
>I would want to use it.

I have used it once. The idea was to have a [very] specialized lock to
solve the following problem. One have to modify a protected object
state and have to have an ability to catch all changes. It was solved
so that some tasks monitoring object state changes ("viewers") were
registerd by the monitored object, so that upon a state change all
consequent changes were blocked until all viewers get notified through
accepting Wait entry and queueing to it again. But the changes caused
by the viewers themselves should not be blocked (otherwise,
deadlock!). Therefore the wait entry was made an entry family to have
two separate queues: one for viewers another for non-viewers. So that
other entries could use Wait (Viewers)'Count and Wait
(non-Viewers)'Count in their barriers.

---
Regards,
Dmitry Kazakov
www.dmitry-kazakov.de



^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2003-02-07  8:44 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-02-06  6:35 Entry Families James S. Rogers
2003-02-06  8:20 ` Dale Stanbrough
2003-02-06 19:03   ` Robert A Duff
2003-02-06 20:34     ` James S. Rogers
2003-02-06 21:17       ` Robert A Duff
2003-02-06 18:28 ` Jeffrey Carter
2003-02-07  3:49 ` Steve
2003-02-07  8:44 ` Dmitry A. Kazakov

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