comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: An Example for Ada.Execution_Time
Date: Fri, 31 Dec 2010 15:14:57 +0100
Date: 2010-12-31T15:14:54+01:00	[thread overview]
Message-ID: <1sbf9ezy4cyrj$.vbev9pev30rq.dlg@40tude.net> (raw)
In-Reply-To: m2d3oi6qkd.fsf@pushface.org

On Fri, 31 Dec 2010 13:05:06 +0000, Simon Wright wrote:

> "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> writes:
> 
>> On Thu, 30 Dec 2010 18:51:30 -0500, BrianG wrote:
>>
>>> Since D.16 defines CPU_Time as if it were a numeric value, is it too 
>>> much to ask why a conversion to some form of numeric value wasn't 
>>> provided?
>>
>> But time is not a number and was not defined as if it were. It is the time
>> differences which are numeric. RM D.14 defines differences of CPU_Time as
>> Time_Span. Time_Span is numeric.
> 
> This is certainly true. However, I remain surprised that .. even delving
> back to v1.2 of the AI .. the proposer found it necessary to have this
> type CPU_Time. The concept being looked for is the number of seconds
> during which *this* task was executing, still sounds like a Duration
> (OK, Time_Span if you must) to me.

Yes, since the epoch is unambiguous: the task start. It does not make much
sense to introduce execution time. Maybe a reason was that introducing
clock returning time span or duration could be strange.

> D14(13/2) says "For each task, the execution time value is set to zero
> at the creation of the task."; however, zero is clearly not a value of
> CPU_Time, so I don't know what is meant.

Yes, Time_Of (0) seem to be the epoch.

>> There is a direct correspondence between two, yet they are
>> conceptually different things.
> 
> I have no idea what's meant by CPU_Time, then! Seems to me it's a giant
> bug waiting to happen. It's clear that the CPU_Time of one task is
> incommensurate with the CPU_Time of another. Given that, what's it
> _for_?

That does not manifest any bug. Except that each task should have had its
own CPU_Time type! Technically, it would be possible to inject an implicit
declaration of a CPU_Time type in the declaration scope of each task. We
could have a task-local "Standard/System" package encapsulating this and
similar stuff. Though, nobody would care to do this.

BTW, you could use CPU_Time as a simulation time within the task. E.g. you
could have subtasks scheduled by the task. The scheduler would use the
CPU_Time in order to activate/deactivate/re-schedule them, periodically
according to the CPU_Time, rather than the system time.

Happy New Year,

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



  reply	other threads:[~2010-12-31 14:14 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-27 18:26 An Example for Ada.Execution_Time anon
2010-12-28  2:31 ` BrianG
2010-12-28 13:43   ` anon
2010-12-29  3:10   ` Randy Brukardt
2010-12-30 23:51     ` BrianG
2010-12-31  9:11       ` Dmitry A. Kazakov
2010-12-31 12:42         ` Niklas Holsti
2010-12-31 14:15           ` Dmitry A. Kazakov
2010-12-31 18:57             ` Niklas Holsti
2011-01-01 13:39               ` Dmitry A. Kazakov
2011-01-01 20:25                 ` Niklas Holsti
2011-01-03  8:50                   ` Dmitry A. Kazakov
2010-12-31 13:05         ` Simon Wright
2010-12-31 14:14           ` Dmitry A. Kazakov [this message]
2010-12-31 14:24           ` Robert A Duff
2010-12-31 22:40           ` Simon Wright
2011-01-01  0:07       ` Randy Brukardt
replies disabled

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