From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,98fcd569e727e97c X-Google-Attributes: gid103376,public From: bsanden@acm.org Subject: Re: Tasking Techniques - Opinions? Date: 1997/06/04 Message-ID: <3394ecbe.215389049@news.pcisys.net>#1/1 X-Deja-AN: 246008163 References: <5n2hjr$ohm$1@news.pacifier.com> Organization: PCI Systems Inc. Newsgroups: comp.lang.ada Date: 1997-06-04T00:00:00+00:00 List-Id: On 4 Jun 1997 01:49:47 GMT, steved@pacifier.com (Steve Doiel) wrote: >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? > Sounds perfectly reasonable to me. Ada 83 forced many more tasks into the designs than were actually justified by real concurrency. The protected objects have made this much more palatable. Letting tasks communicate via shared objects is also the traditional way of doing these things. Prof. Bo Sanden Colorado Technical University 4435 N. Chestnut Street Colorado Springs, CO 80907-3896 Email: bsanden@acm.org Http://www.isse.gmu.edu/faculty/bsanden