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: 9 Nov 91 22:12:57 GMT From: ogicse!milton!mfeldman@uunet.uu.net (Michael Feldman) Subject: Re: Tasks in Packages Message-ID: <1991Nov9.221257.22539@milton.u.washington.edu> List-Id: In article <1991Nov9.061122.1026@regina.cs.uregina.ca> plummer@hercules.cs.ureg ina.ca (Dave Plummer) writes: >I would like to write a package that contains two concurrent tasks, which >I would be able to include in another procedure. > >If I with...use... that package inside my other procedure, will these two >tasks get spawned when I call my procedure that includes them? And >should the with...use.... be inserted before or within my procedure >declaration? > The tasks will be activated at the time the package is elaborated, which is just before your "with"-ing program (henceforth the "client") is given control. A "with" _must_ come _before_ the "procedure" line of the client. A "use" can appear anywhere, in case you wish to control the direct visibility of the stuff in the package. Beginners often put the "use" together with the "with", so the two must precede the first line of the client. I presume you know that if anything in the tasks is to be visible outside the package (for example, if anything in your client wants to call an entry in one of the tasks), the task specs had better appear in the package spec. Otherwise - if the task specs are in the package body - the tasks will chug away but their entries can't be called from outside. 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) -------------------------------------------------------------------------------