comp.lang.ada
 help / color / mirror / Atom feed
* Tasks in Packages
@ 1991-11-09  6:11 aunro!alberta!access.usask.ca!regina!hercules.cs.uregina.ca!plummer
  0 siblings, 0 replies; 2+ messages in thread
From: aunro!alberta!access.usask.ca!regina!hercules.cs.uregina.ca!plummer @ 1991-11-09  6:11 UTC (permalink / raw)


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?

Thanks,
Dave

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Tasks in Packages
@ 1991-11-09 22:12 Michael Feldman
  0 siblings, 0 replies; 2+ messages in thread
From: Michael Feldman @ 1991-11-09 22:12 UTC (permalink / raw)


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)
-------------------------------------------------------------------------------

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~1991-11-09 22:12 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1991-11-09  6:11 Tasks in Packages aunro!alberta!access.usask.ca!regina!hercules.cs.uregina.ca!plummer
  -- strict thread matches above, loose matches on Subject: below --
1991-11-09 22:12 Michael Feldman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox