comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: Ada and linux real time
Date: Wed, 7 Mar 2012 15:18:01 +0100
Date: 2012-03-07T15:18:01+01:00	[thread overview]
Message-ID: <13z45jd9irz9x.1j2hj7ayxwkyj.dlg@40tude.net> (raw)
In-Reply-To: 3a01f684-b544-4051-985d-58aab98e832c@v2g2000vbx.googlegroups.com

On Wed, 7 Mar 2012 04:10:14 -0800 (PST), slos wrote:

> On 7 mar, 09:23, "Dmitry A. Kazakov" <mail...@dmitry-kazakov.de>
> wrote:
>> On Tue, 6 Mar 2012 13:19:24 -0800 (PST), slos wrote:
>>> I have tried some code on both RT and non RT kernels but was not
>>> impressed by the difference.
>>
>> What kind of difference you expected to see?
> 
> I can't post the code from the place I am, so I will just describe it.
> 
> My little test schedules a periodic task with a period of let's say
> 10ms.

I see.

The problem is likely not in the Ada's RTL but in the OS. Usually Ada
(specifically GNAT) maps tasks onto OS-native threads. You should look
after the OS settings which control scheduling. These are OS specific, but
10ms looks quite plausible.

> The periodic task then calls the Ada.Real_Time.Clock and measures the
> difference to the scheduled time.

Ada.Real_Time.Clock would typically use the OS time services, which,
frequently have very low accuracy. In order to check a particular OS, call
Ada.Real_Time.Clock several times and compare the results.

I cannot tell for Linux, because I didn't use it for real-time purposes
yet. Ideally it should derive the system time from the TSC. However
scheduling would likely limited when controlled by timer interrupts. The
minimal waiting time is then determined by the timer's period. You should
look for this kernel setting if you want go below 10ms, or what the actual
limit is.

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



  reply	other threads:[~2012-03-07 14:17 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-06 21:19 Ada and linux real time slos
2012-03-07  8:23 ` Dmitry A. Kazakov
2012-03-07 12:10   ` slos
2012-03-07 14:18     ` Dmitry A. Kazakov [this message]
2012-03-08  2:38       ` Eilie
2012-03-08  8:27         ` Dmitry A. Kazakov
2012-03-08 12:04         ` Simon Clubley
2012-03-08 21:45           ` slos
2012-03-15  2:35             ` BrianG
2012-03-16 20:36               ` slos
2012-03-17 12:34                 ` Simon Wright
2012-03-17 15:50                   ` Simon Wright
2012-03-18 22:03                     ` slos
2012-03-19 11:29                       ` Georg Bauhaus
2012-03-19 13:01                         ` Simon Wright
2012-03-19 13:12                           ` slos
2012-03-19 13:30                             ` slos
2012-03-19 13:35                             ` Dmitry A. Kazakov
2012-03-19 16:11                               ` slos
2012-03-19 17:55                                 ` Dmitry A. Kazakov
2012-03-19 22:20                                   ` slos
2012-03-20  8:04                                     ` Dmitry A. Kazakov
2012-03-19 13:20                           ` Dmitry A. Kazakov
replies disabled

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