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=0.7 required=5.0 tests=BAYES_20,FREEMAIL_FROM, INVALID_MSGID,PLING_QUERY autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,2c8fad0bcc16513,start X-Google-Attributes: gid103376,public From: ericferg@aol.com Subject: HELP! Two-way Task Communication in Ada (Ada83/Ada95)??? Date: 1996/11/24 Message-ID: <19961124062800.BAA12781@ladder01.news.aol.com>#1/1 X-Deja-AN: 198382306 organization: AOL http://www.aol.com newsgroups: comp.lang.ada x-admin: news@aol.com Date: 1996-11-24T00:00:00+00:00 List-Id: I have a question concerning task communication in Ada95. I have a DOS-based Ada95 program which runs several independent tasks, each of which is supposed to represent a distinct object in a dynamic simulation of an Air Traffic Control System. The scenario looks something like this ... ================================================================= Task Communication Model --- 1) Controlled Airspace (CAS) object can only pass messages to ATCS driver 2) ATCS driver sends/receives messages from CAS or external objects. CPES ----------------------------------> |----ATCS Task----| <------> |---- CAS ----| Aircraft Radar ---------------------------> |----ATCS Task----| <------> |---- CAS ----| Weather Radar ----------------------------> |----ATCS Task----| <------> |---- CAS ----| FPIS <------------------------------------------> |----ATCS Task----| <------> |---- CAS ----| Log <--------------------------------------------------- |----ATCS Task----| <------> |---- CAS ----| DISPLAY <------------------------------------------- |----ATCS Task----| <------> |---- CAS ----| FAA <-------------------------------------------------- |----ATCS Task----| <------> |---- CAS ----| Remote ATCS <------------------------------------> |----ATCS Task----| <------> |---- CAS ----| Notice the arrowheads ... they denote the possible directions of the communications between the objects above. =============================================================== BACKGROUND --- The ATCS object (ATCS_Task) needs two-way communication with just about all other objects/tasks. It acts as a middleman between the external objects (everything to the left of ATCS_Task) and the CAS. The ATCS_Task can be considered as a buffer that shields the CAS from the external world. All communication between the CAS and the external world is done through the ATCS_Task. Cohen's "Ada as a Second Language" text has an examples of how to get two independent tasks to talk to each other (mainly, put the task specs in one library unit (e.g., main procedure), and put each task body in a separately compiled library unit of its own). MY PROBLEM --- I patterned my simulation program after Cohen's example, but the two-way task communication doesn't seem to work. Let me say right now that I'm not an Ada novice (e.g., I'm currently using GNAT 3.05 --- have used GNAT since it's first release ... I also have Aonix's ObjectAda environment). For some strange reason, I just can't get >> two-way communication << between independent tasks. One-way communication works just fine. MY REQUEST --- Does anyone have a SHORT example of two-way task communication that they can post to this newsgroup (i.e., two tasks which have full visibility of each other, and which can accept entry calls from each other)? I'm posting this plea on 23 Nov 96. If you have an example for me, please post it within a week --- I'll check back daily. I don't want to be overwhelmed by replies --- and don't want to clog up this newsgroup, either --- so please DO NOT respond to my plea after 30 Nov 96. Thanks in advance for any help you can provide. Eric Ferguson