From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00, PP_MIME_FAKE_ASCII_TEXT autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII X-Google-Thread: 103376,a023f5759065182 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-11-27 06:17:07 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!cyclone.bc.net!news-out.newsfeeds.com!propagator2-maxim!news-in.spamkiller.net!news.telia-iberia.com!newsf01.ono.com!news.ono.com.POSTED!not-for-mail From: "Ivan" Newsgroups: comp.lang.ada References: Subject: Re: Selective accept in Ada tasking X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4920.2300 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4920.2300 Message-ID: Date: Wed, 27 Nov 2002 14:17:02 GMT NNTP-Posting-Host: 62.42.227.26 X-Complaints-To: abuse@ono.com X-Trace: news.ono.com 1038406622 62.42.227.26 (Wed, 27 Nov 2002 15:17:02 MET) NNTP-Posting-Date: Wed, 27 Nov 2002 15:17:02 MET Xref: archiver1.google.com comp.lang.ada:31252 Date: 2002-11-27T14:17:02+00:00 List-Id: 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" 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