comp.lang.ada
 help / color / mirror / Atom feed
* Tasking Techniques - Opinions?
@ 1997-06-04  0:00 Steve Doiel
  1997-06-03  0:00 ` Tom Moran
                   ` (3 more replies)
  0 siblings, 4 replies; 11+ messages in thread
From: Steve Doiel @ 1997-06-04  0:00 UTC (permalink / raw)



Over the years I have used a number of real time operating systems
(or kernal's).  Those systems made use of "semaphores," "events,"
"mutexes," "tasks," "queues," and other synchronization or tasking
primatives.  The terminology differs in terms of what exactly an
"event" is, but the concepts are similar.

I have read what John Barnes has to say about tasks and protected
types in "Programming in Ada 95."  It appears that the tools for
creating and synchronizing tasks in Ada are simple, but it leaves
me wondering about the best techniques to use to perform the job
at hand.

For example:
I am working on a communications subsystem.  In this subsystem
various tasks produce packages of data that are to be transmitted
using BSD sockets on TCP/IP.

In the current implementation, one module maintains a free pool
of packet buffers.  Access to the free pool is done using a
protected type.  A second module contains a protected type that
contains a FIFO of packet buffers (the send queue).  A third
module contains a "send task" that is in a short loop that
removes entries from the send queue, transmits the data out the
socket and then returns the packet buffer to the free pool.

In the above description the gory details of how the socket
initially gets set up, what happens when a socket goes away,
and other error handling are left out to keep the discussion
simple.

Now the question:
Is this a reasonable implementation?  Or is there a better
approach?

I am making almost no use of Ada's "rendevous," and am leaning
more toward using protected types to pass data through queues.

Is this poor practice?  I understand that with Ada 83 this
was not an option, but still wonder if this is the best
approach.

Opinions?

Steve Doiel
steved@pacifier.com





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

end of thread, other threads:[~1997-06-10  0:00 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1997-06-04  0:00 Tasking Techniques - Opinions? Steve Doiel
1997-06-03  0:00 ` Tom Moran
1997-06-07  0:00   ` Steve Doiel
1997-06-04  0:00 ` Jon S Anthony
1997-06-04  0:00 ` bsanden
1997-06-04  0:00   ` Samuel A. Mize
1997-06-05  0:00     ` Jon S Anthony
1997-06-06  0:00       ` Samuel A. Mize
1997-06-07  0:00       ` Robert Dewar
1997-06-10  0:00         ` Jon S Anthony
1997-06-05  0:00 ` Robert A Duff

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