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=-1.9 required=3.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.5-pre1 Date: 14 Nov 91 03:13:50 GMT From: ogicse!milton!mfeldman@uunet.uu.net (Michael Feldman) Subject: Re: HELP! HELP! Dynamic InterTask Communication between different Pac kages Message-ID: <1991Nov14.031350.28704@milton.u.washington.edu> List-Id: In article <13NOV199116031506@elroy.uh.edu> cosc143u@elroy.uh.edu (91F9774) wri tes: [ stuff deleted ] >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. >. >package t is > task type taskt is > entry callt; > end taskt; >end package t; >package body t is > task type taskt is > begin > accept callt; > taskp.callp; > end taskt; >end t; > . >package p is > task type taskp is > entry callp; > end taskp; >end package p; >package body p is > task type taskp is > begin > accept callp; > taskt.callt; > end taskp; >end p; > You're on the right track. You just need to get the compilation order right. Add to package body (NOT spec) p the line with t; and to the package body t the line with p; then compile in the following order: spec of t spec of p body of t body of p also the entry calls need to be qualified with the package names, e.g. t.taskt.callt (or you can use a USE clause to get the same effect, if you don't mind USEs). You'll also need a main program that with's both packages, even if it's a begin-null-end main (you need something to cause the packages to be elaborated, in order to activate the tasks). Write back by personal mail if you have more questions. Good luck. Mike ------------------------------------------------------------------------------- Michael B. Feldman Visiting Professor 1991-92 Professor Dept. of Comp. Sci. and Engrg. Dept. of Elect. Engrg. and Comp. Sci. University of Washington FR-35 The George Washington University Seattle, WA 98105 Washington, DC 20052 mfeldman@cs.washington.edu mfeldman@seas.gwu.edu (206) 632-3794 (voice) (202) 994-5253 (voice) (206) 543-2969 (fax) (202) 994-5296 (fax) -------------------------------------------------------------------------------