TEAM-ADA Archives

Team Ada: Ada Programming Language Advocacy

TEAM-ADA@LISTSERV.ACM.ORG

Options: Use Classic View

Use Proportional Font
Show HTML Part by Default
Show All Mail Headers

Topic: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Jeffrey Carter <[log in to unmask]>
Fri, 17 May 2002 18:22:15 -0700
text/plain (24 lines)
"C. Daniel Cooper" wrote asking about the use of the subscribe and
publish approach, which uses callbacks.

Callbacks are generally a mechanism used by sequential languages in
inherently concurrent situations. The most common example is the
inherent concurrency of windowing systems and the C language. Callbacks
complicate software, making it harder to understand and modify
successfully.

With a concurrent language there is no need for callbacks, except for
interfacing to software designed for use by sequential languages.

In this example, the event handler can provide an entry on which tasks
may block, being released when the event occurs. Each "subscriber" can
provide a waiting task that waits on the event, then invokes whatever
action the specific "subscriber" requires. A "subscriber" can
"unsubscribe" by having the waiting task terminate the entry call
prematurely.

--
Jeff Carter
"Monsieur Arthur King, who has the brain of a duck, you know."
Monty Python & the Holy Grail

ATOM RSS1 RSS2