TEAM-ADA Archives

Team Ada: Ada Programming Language Advocacy


Options: Use Classic View

Use Monospaced Font
Show Text 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

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

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