TEAM-ADA Archives

Team Ada: Ada Programming Language Advocacy

TEAM-ADA@LISTSERV.ACM.ORG

Options: Use Classic View

Use Monospaced Font
Show HTML Part by Default
Condense Mail Headers

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

Print Reply
Content-Transfer-Encoding: 7bit
Sender: "Team Ada: Ada Advocacy Issues (83 & 95)" <[log in to unmask]>
From: Jeffrey Carter <[log in to unmask]>
Date: Fri, 17 May 2002 18:22:15 -0700
Content-Type: text/plain; charset=us-ascii
MIME-Version: 1.0
Reply-To: Jeffrey Carter <[log in to unmask]>
Parts/Attachments: 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