From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.5-pre1 (2020-06-20) on ip-172-31-74-118.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-0.0 required=3.0 tests=BAYES_20 autolearn=ham autolearn_force=no version=3.4.5-pre1 Date: 15 Nov 91 17:19:02 GMT From: nuchat!shell!spjerint!jon@uunet.uu.net Subject: Re: HELP! HELP! Dynamic InterTask Communication between different Pac kages Message-ID: <1991Nov15.171902.1813@shell.shell.com> List-Id: >I need to get two tasks in two different packages to communicat with each othe r >the problem is that it looks like it is impossible for both tasks to know abou t >each other unless they are in the same package. In C I would just make up a >header file with forward references to both tasks just to define what they wer e. Well, in Ada, you do the same thing. Only with package specs instead of header files. >I know this is possible in Ada, but so far, no luck. What is wrong with my >approach (example code follows). Thanks in advance for any help. >. In one file, put this stuff >package t is > task type taskt is > entry callt; > end taskt; >end package t; in another, put this guy, with the added lines with p; use p; >package body t is > task type taskt is > begin > accept callt; > taskp.callp; > end taskt; >end t; > . File 3 is this >package p is > task type taskp is > entry callp; > end taskp; >end package p; File 4 is this, with added lines with t; use t; >package body p is > task type taskp is > begin > accept callp; > taskt.callt; > end taskp; >end p; Then, compile the two specs first, then the two bodies. Should work fine. I take it you've really got something more interesting going on than your example shows. Otherwise, this code doesn't go anywhere, since both tasks are waiting on a call from the other one. Jon Holdman, jon@shell.com