comp.lang.ada
 help / color / mirror / Atom feed
From: "Grein, Christoph" <christoph.grein@eurocopter.com>
Subject: Re: Selective accept in Ada tasking
Date: Wed, 27 Nov 2002 11:02:08 +0100 (MET)
Date: 2002-11-27T11:02:08+01:00	[thread overview]
Message-ID: <mailman.1038391741.12325.comp.lang.ada@ada.eu.org> (raw)

> I'm a beginner and I have a problem. This code makes my CPU reach
> 100%:

Looks like a bug to me. It should stop at the select and wait until there is an 
entry call. Is it possible that there is always a call present?

What happens if you remove the terminate alternative? Should not really have an 
effect, but just to see whether there is a problem in Gnat.

> 
> task body Man_Motor1 is
> begin
> 	while not Fin loop
> 		select			
> 			accept Subir;
> 			null; -- Some actions
> 		or
> 			accept Bajar;
> 			null; -- Some actions
> 		or
> 			accept Parar;
> 			null; -- Some actions
> 		or
> 			terminate;
> 		end select;
> 	end loop;
> end Man_Motor1;
> 
> I'm using GNAT 3.14 in a Windows XP platform. If I introduce a delay
> before de end loop all it's OK, but what I want is that the task keep
> sleeping till it has a call to an entry without consuming a lot of CPU
> time.
> 
> Can anybody help me?
> Thank you very much.
> _______________________________________________
> comp.lang.ada mailing list
> comp.lang.ada@ada.eu.org
> http://ada.eu.org/mailman/listinfo/comp.lang.ada



             reply	other threads:[~2002-11-27 10:02 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-11-27 10:02 Grein, Christoph [this message]
2002-11-27 14:17 ` Selective accept in Ada tasking Ivan
2002-11-27 14:56   ` Preben Randhol
2002-11-27 15:02 ` Adrian Knoth
  -- strict thread matches above, loose matches on Subject: below --
2002-11-27  8:22 Ivan Paniagua
2002-11-27  9:33 ` Peter Hermann
2002-11-27 14:41 ` SteveD
2002-11-27 16:14 ` tmoran
2002-11-29  7:02   ` Ivan
replies disabled

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