From: paniaguaivan@hotmail.com (Ivan Paniagua)
Subject: Selective accept in Ada tasking
Date: 27 Nov 2002 00:22:41 -0800
Date: 2002-11-27T08:22:41+00:00 [thread overview]
Message-ID: <c560b18f.0211270022.72569d49@posting.google.com> (raw)
I'm a beginner and I have a problem. This code makes my CPU reach
100%:
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.
next reply other threads:[~2002-11-27 8:22 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-11-27 8:22 Ivan Paniagua [this message]
2002-11-27 9:33 ` Selective accept in Ada tasking Peter Hermann
2002-11-27 14:41 ` SteveD
2002-11-27 16:14 ` tmoran
2002-11-29 7:02 ` Ivan
-- strict thread matches above, loose matches on Subject: below --
2002-11-27 10:02 Grein, Christoph
2002-11-27 14:17 ` Ivan
2002-11-27 14:56 ` Preben Randhol
2002-11-27 15:02 ` Adrian Knoth
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox