comp.lang.ada
 help / color / mirror / Atom feed
From: "Ivan" <paniaguaivan@QUITAESTOhotmail.com>
Subject: Re: Selective accept in Ada tasking
Date: Wed, 27 Nov 2002 14:17:02 GMT
Date: 2002-11-27T14:17:02+00:00	[thread overview]
Message-ID: <yt4F9.510$6m.65928@news.ono.com> (raw)
In-Reply-To: mailman.1038391741.12325.comp.lang.ada@ada.eu.org

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1511 bytes --]

    I have found some resources concerning this, like
http://www.cs.utsa.edu/~danlo/ada/ada95.htm that recomend a delay 0.0. It's
not a serious solution but it runs. Maybe another compiler instead of GNAT
takes a better solution?

    Thanx.



"Grein, Christoph" <christoph.grein@eurocopter.com> escribi� en el mensaje
news:mailman.1038391741.12325.comp.lang.ada@ada.eu.org...
> > 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 14:17 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-11-27 10:02 Selective accept in Ada tasking Grein, Christoph
2002-11-27 14:17 ` Ivan [this message]
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