comp.lang.ada
 help / color / mirror / Atom feed
* Re: TASKS
@ 1992-10-06 11:23 van-bc!cs.ubc.ca!utcsri!rpi!usc!sdd.hp.com!spool.mu.edu!darwin.sura.net!c
  0 siblings, 0 replies; 6+ messages in thread
From: van-bc!cs.ubc.ca!utcsri!rpi!usc!sdd.hp.com!spool.mu.edu!darwin.sura.net!c @ 1992-10-06 11:23 UTC (permalink / raw)


In article <1992Oct6.022450.9087@ringer.cs.utsa.edu> mperez@ringer.cs.utsa.edu 
(Michael Perez) writes:
>I am learning ada and I was having trouble with TASK. My code looks
>something like this
> 
Your task body performs the accept only once, after that the task becomes 
terminated, and you get a TASKING_ERROR when calling the entry a second time.
Modify your task as follows:

>
>TASK body Name IS
>begin
  loop
   select
>    Accept filename(...);
>         ...........
>         statements
>         ...........
>    End filename;
   or
     terminate;
   end select;
  end loop;
>end Name;



-- 
Boris Pelakh		Ada Project Leader          pelakh@convex.com
		     Convex Computer Corporation
"If winning isn't important, why keep score ?"	-- Lt. Worf, Star Trek TNG.
			

^ permalink raw reply	[flat|nested] 6+ messages in thread
* tasks
@ 2002-02-26  9:01 Edmund
  2002-02-26 11:35 ` tasks Frank J. Lhota
  2002-02-26 11:37 ` tasks Larry Kilgallen
  0 siblings, 2 replies; 6+ messages in thread
From: Edmund @ 2002-02-26  9:01 UTC (permalink / raw)


I'm a Ada novice and have this question:
can tasks be implemented across 2 different packages?





^ permalink raw reply	[flat|nested] 6+ messages in thread
* Re: TASKS
@ 1992-10-06 19:47 Bob Kitzberger
  0 siblings, 0 replies; 6+ messages in thread
From: Bob Kitzberger @ 1992-10-06 19:47 UTC (permalink / raw)


mperez@ringer.cs.utsa.edu (Michael Perez) writes:

>TASK body Name IS
>begin
>    Accept filename(...);
>         ...........
>         statements
>         ...........
>    End filename;
>end Name;

>It seems like the TASK is executed one time then I always get a
>TASKING_ERROR. 

You need to put a loop..end loop pair around the accept statement in the task,
otherwise your task Name will accept a single entry call, and then terminate.

	.Bob.
----------------
Bob Kitzberger          VisiCom Laboratories, Inc.
rlk@visicom.com         10052 Mesa Ridge Court, San Diego CA 92121 USA
                        +1 619 457 2111    FAX +1 619 457 0888

^ permalink raw reply	[flat|nested] 6+ messages in thread
* TASKS
@ 1992-10-06  2:24 elroy.jpl.nasa.gov!swrinde!ringer!mperez
  0 siblings, 0 replies; 6+ messages in thread
From: elroy.jpl.nasa.gov!swrinde!ringer!mperez @ 1992-10-06  2:24 UTC (permalink / raw)


I am learning ada and I was having trouble with TASK. My code looks
something like this
 
PROCEDURE joe IS
   ......
   ......
   declarations
   .....

TASK Name IS
     entry filename(...);
END;

TASK body Name IS
begin
    Accept filename(...);
         ...........
         statements
         ...........
    End filename;
end Name;

Begin
   while (....) Loop
       Name.filename(....);
   end loop;
end joe;

It seems like the TASK is executed one time then I always get a
TASKING_ERROR. I tried putting an exception to handle this error but
it didn't work. I think there is something about TASK that I don't understand
if anyone has any comments please let me know.
                                                    Thanks.

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

end of thread, other threads:[~2002-02-26 11:37 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1992-10-06 11:23 TASKS van-bc!cs.ubc.ca!utcsri!rpi!usc!sdd.hp.com!spool.mu.edu!darwin.sura.net!c
  -- strict thread matches above, loose matches on Subject: below --
2002-02-26  9:01 tasks Edmund
2002-02-26 11:35 ` tasks Frank J. Lhota
2002-02-26 11:37 ` tasks Larry Kilgallen
1992-10-06 19:47 TASKS Bob Kitzberger
1992-10-06  2:24 TASKS elroy.jpl.nasa.gov!swrinde!ringer!mperez

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