comp.lang.ada
 help / color / mirror / Atom feed
* multitasking: finishing execution
@ 2002-06-20  9:57 chris.danx
  2002-06-20 12:48 ` Nige
  2002-06-20 14:53 ` Stephen Leake
  0 siblings, 2 replies; 7+ messages in thread
From: chris.danx @ 2002-06-20  9:57 UTC (permalink / raw)


Hi,

Is calling the entry finish sufficient to terminate the task?  The code of
the entry isn't the concern, but the behaviour of entries.  Consider the
following procedure

procedure finish_tasks is
begin
   some_task.finish;                                     -- 1
   ada.text_io.put ("some_task should have terminated"); -- 2
end finish_tasks;


-- sample task code
--
loop
   select
      accept Finish;
      exit;
   else
      -- do some processing (sample code)
      --
      if x < integer'last then
         x := x + 1;
      end if;
   end select;
end loop;


Can the call to some_task.finish time out?  If it can there's no guarantee
that the task has finished executing before the call to ada.text_io.put is
executed and the program may fail to terminate because it has running tasks,
correct?

As you can see I'm a little confused by the fact that an entry can time out.
Does it mean that the call can time out no matter what or that the task has
to contain the appropriate code for an entry call to time out (such as a
delay altenative)?  i.e. will the procedure wait indefinitely for the task
to terminate or will it abandon the entry call after some time elapses?

If the code doesn't work as intended, what solution would you recommend?  Is
there a better way?


Thanks,
Chris





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

end of thread, other threads:[~2002-06-21 18:14 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-06-20  9:57 multitasking: finishing execution chris.danx
2002-06-20 12:48 ` Nige
2002-06-20 16:19   ` chris.danx
2002-06-20 20:40     ` Stephen Leake
2002-06-20 14:53 ` Stephen Leake
2002-06-20 19:30   ` chris.danx
2002-06-21 18:14     ` Ted Dennison

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