Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Ada > Re: Periodic ta...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 13 of 13 Topic 5810 of 5966
Post > Topic >>

Re: Periodic tasks - organization

by "Dmitry A. Kazakov" <mailbox@[EMAIL PROTECTED] > Jul 19, 2008 at 12:22 PM

On Fri, 18 Jul 2008 18:37:23 -0700 (PDT), Anh Vo wrote:

> On Jul 18, 9:22 am, "Dmitry A. Kazakov" <mail...@[EMAIL PROTECTED]
>
> wrote:

>> This is IMO not what Maciej wanted, because as Simon has pointed out
>> protected procedures are very limited in what they allowed do and in
how
>> they do it.
> 
> Why is Protected Procedure limited for this purpose?

Because it is executed inside a protected action, see RM 9.5.1.

In particular, ada-gem-15 is a bounded error, because it calls to Put_Line
from a declared protected action. Note that Put_Line is potentially
blocking.

Even if Put_Line does not block, its execution time is unacceptable for a
protected action. Protected actions are thought having *semantically* zero
execution time.

[Yes, GNAT allows Put_Line in protected actions for debugging purpose, but
to do it in production code would be a very bad idea.]

>> Another point is that even if that were the context of a task (which is
>> not), it still would be an unsatisfactory design, because
simultaneously
>> triggered actions would block each other when overlapping.
> 
> Again, look at the full code in Ada-Gem-15. There is no overlap action
> at all.

It would be if there *officially* existed a task doing the notification
callbacks.

*Unofficially*, depending on the implementation, the compiler might use
one
task for all instances of Timing_Event or system services (like waitable
timers). In both cases you would have one system thread servicing all
callbacks one after another. Certainly, an implementation could choose to
use one task per each Timing_Event instance, but it would rather be
surprising, because there is no reason to do that, as the callback is
declared to fit into a protected action. Well, having said that, on a
multi-core CPU it could make sense to start one timer task for each core,
but I doubt that any Ada vendor would really care. There seems to be
little
use in Ada.Real_Time.Timing_Events except for bare boards with hardware
timer interrupts mapped directly to Timing_Events.

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de
 




 13 Posts in Topic:
Periodic tasks - organization
Maciej Sobczak <see.my  2008-07-13 14:47:53 
Re: Periodic tasks - organization
tmoran@[EMAIL PROTECTED]   2008-07-13 18:35:55 
Re: Periodic tasks - organization
george.priv@[EMAIL PROTEC  2008-07-13 20:52:44 
Re: Periodic tasks - organization
"Alex R. Mosteo"  2008-07-14 11:08:33 
Re: Periodic tasks - organization
Anh Vo <anhvofrcaus@[E  2008-07-14 08:31:07 
Re: Periodic tasks - organization
Simon Wright <simon.j.  2008-07-16 22:38:51 
Re: Periodic tasks - organization
Anh Vo <anhvofrcaus@[E  2008-07-16 15:47:56 
Re: Periodic tasks - organization
Simon Wright <simon.j.  2008-07-17 20:31:11 
Re: Periodic tasks - organization
Anh Vo <anhvofrcaus@[E  2008-07-18 08:31:29 
Re: Periodic tasks - organization
"Dmitry A. Kazakov&q  2008-07-18 18:22:52 
Re: Periodic tasks - organization
Simon Wright <simon.j.  2008-07-20 10:46:45 
Re: Periodic tasks - organization
Anh Vo <anhvofrcaus@[E  2008-07-18 18:37:23 
Re: Periodic tasks - organization
"Dmitry A. Kazakov&q  2008-07-19 12:22:34 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Fri Nov 21 14:25:26 CST 2008.