comp.lang.ada
 help / color / mirror / Atom feed
* Re: Timers in application
  1999-06-08  0:00 Timers in application askeya
  1999-06-08  0:00 ` dennison
@ 1999-06-08  0:00 ` dennison
  1999-06-08  0:00 ` David Brown
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 9+ messages in thread
From: dennison @ 1999-06-08  0:00 UTC (permalink / raw)


In article <375D1E02.8F1C0D6E@res.raytheon.com>,
  askeya <askeya@res.raytheon.com> wrote:
> I am developing a Solaris 2.6 application (Ada95 with Apex) that needs
a
> timer service that allows me to schedule multiple simultaneous
wakeups.
> I have looked at "setitimer" and "alarm" man pages, but these services
> appear to only allow one timer per process and/or thread.  Is this
> correct?
>
> I have read some postings about Posix timers, but can not figure out
any
> key words to use for man pages.  Will Posix timers allow multiple
> simultaneous timers?  If so, what man pages can I look at?
>
> Any other ideas for timer services I can use?  I need a granularity of
> at least 100 milliseconds, but faster would be better.  I am
developing
> in Ada95 but can create interfaces into standard C libs if necessary.

Odd, you are asking an OS question in an Ada newsgroup, but I may yet
have an Ada answer for you.

What's wrong with the "delay until" statement? Does your compiler not
support the real-time annex (D)? We are using "delay until" for
scheduling on a flight simulator, parts of which run at 2KHz (every 500
*micro*seconds) which we intend to FAA certify. I'd be quite shocked if
your compiler couldn't deliver a granularity better then 100
milliseconds.

If your compiler can't do that for you, I suggest you switch to one that
does. In the long run it will be way cheaper than playing with
non-portable OS calls.

--
T.E.D.


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.




^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Timers in application
  1999-06-08  0:00 Timers in application askeya
@ 1999-06-08  0:00 ` dennison
  1999-06-08  0:00   ` James E. Hopper
  1999-06-08  0:00 ` dennison
                   ` (4 subsequent siblings)
  5 siblings, 1 reply; 9+ messages in thread
From: dennison @ 1999-06-08  0:00 UTC (permalink / raw)


In article <375D1E02.8F1C0D6E@res.raytheon.com>,
  askeya <askeya@res.raytheon.com> wrote:
> I am developing a Solaris 2.6 application (Ada95 with Apex) that needs
a
> timer service that allows me to schedule multiple simultaneous
wakeups.
> I have looked at "setitimer" and "alarm" man pages, but these services
> appear to only allow one timer per process and/or thread.  Is this
> correct?
>
> I have read some postings about Posix timers, but can not figure out
any
> key words to use for man pages.  Will Posix timers allow multiple
> simultaneous timers?  If so, what man pages can I look at?
>
> Any other ideas for timer services I can use?  I need a granularity of
> at least 100 milliseconds, but faster would be better.  I am
developing
> in Ada95 but can create interfaces into standard C libs if necessary.

Odd, you are asking an OS question in an Ada newsgroup, but I may yet
have an Ada answer for you.

What's wrong with the "delay until" statement? Does your compiler not
support the real-time annex (D)? We are using "delay until" for
scheduling on a flight simulator, parts of which run at 2KHz (every 500
*micro*seconds) which we intend to FAA certify. I'd be quite shocked if
your compiler couldn't deliver a granularity better then 100
milliseconds.

If your compiler can't do that for you, I suggest you switch to one that
does. In the long run it will be way cheaper than playing with
non-portable OS calls.

--
T.E.D.


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.




^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Timers in application
  1999-06-08  0:00 Timers in application askeya
  1999-06-08  0:00 ` dennison
  1999-06-08  0:00 ` dennison
@ 1999-06-08  0:00 ` David Brown
  1999-06-08  0:00 ` Matthew Heaney
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 9+ messages in thread
From: David Brown @ 1999-06-08  0:00 UTC (permalink / raw)


>>>>> On Tue, 08 Jun 1999 07:43:30 -0600, askeya <askeya@res.raytheon.com> said:

> I am developing a Solaris 2.6 application (Ada95 with Apex) that needs a
> timer service that allows me to schedule multiple simultaneous wakeups. 

> Any other ideas for timer services I can use?  I need a granularity of
> at least 100 milliseconds, but faster would be better.  I am developing
> in Ada95 but can create interfaces into standard C libs if necessary.

Why not implement this with the services that Ada provides?  Most
likely, your Ada library will provide the same granularity as your OS
for timers.

You could implement a single task that you register with, that sorts
and keeps track of what wakeups are needed.  Or, if the number of
wakeups is smaller, have a separate task for each wakeup.

Hope this helps,
Dave Brown




^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Timers in application
  1999-06-08  0:00 Timers in application askeya
                   ` (2 preceding siblings ...)
  1999-06-08  0:00 ` David Brown
@ 1999-06-08  0:00 ` Matthew Heaney
  1999-06-09  0:00 ` askeya
  1999-06-09  0:00 ` Simon Wright
  5 siblings, 0 replies; 9+ messages in thread
From: Matthew Heaney @ 1999-06-08  0:00 UTC (permalink / raw)


On 08 Jun 1999 06:43:30 -0700, askeya <askeya@res.raytheon.com> wrote:

> I am developing a Solaris 2.6 application (Ada95 with Apex) that needs a
> timer service that allows me to schedule multiple simultaneous wakeups. 
> I have looked at "setitimer" and "alarm" man pages, but these services
> appear to only allow one timer per process and/or thread.  Is this
> correct?

What's wrong with using "delay until"?  The whole point of Ada run-time
is that you don't have to muck with OS calls.






^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Timers in application
  1999-06-08  0:00 ` dennison
@ 1999-06-08  0:00   ` James E. Hopper
  1999-06-09  0:00     ` dennison
  0 siblings, 1 reply; 9+ messages in thread
From: James E. Hopper @ 1999-06-08  0:00 UTC (permalink / raw)


Its been several years, but when we needed timers with a flight sim i
was working on to synchronize the executive, we found ada constructs
either took to much over head, or did not have sufficient accuracy.  if
i had it to do right now, i would look at the ada delay until etc, but
i would start by testing it to see it met my requirements. 

if you decide not to use it be sure the ada runtime is not using the
itimer you want to use for its delay statement ;-)  on sgi the itimer
accuracy is different depending if the process priority is in the real
time band or not.  

like i said its been a number of years (probably 5) since i did this
and it was for vads, not gnat.  so your milage may vary! 

jim




^ permalink raw reply	[flat|nested] 9+ messages in thread

* Timers in application
@ 1999-06-08  0:00 askeya
  1999-06-08  0:00 ` dennison
                   ` (5 more replies)
  0 siblings, 6 replies; 9+ messages in thread
From: askeya @ 1999-06-08  0:00 UTC (permalink / raw)


I am developing a Solaris 2.6 application (Ada95 with Apex) that needs a
timer service that allows me to schedule multiple simultaneous wakeups. 
I have looked at "setitimer" and "alarm" man pages, but these services
appear to only allow one timer per process and/or thread.  Is this
correct?

I have read some postings about Posix timers, but can not figure out any
key words to use for man pages.  Will Posix timers allow multiple
simultaneous timers?  If so, what man pages can I look at?

Any other ideas for timer services I can use?  I need a granularity of
at least 100 milliseconds, but faster would be better.  I am developing
in Ada95 but can create interfaces into standard C libs if necessary.

Thanx.
-- 
---------------------------------------------------
|                 Andy Askey                      |
|              Software Engineer                  |
|           Raytheon Systems Company              |
|   670 Discovery Drive, Huntsville, AL  35806    |
|   Phone: (256) 971-2367  Fax: (256) 971-2306    |
|        andrew_j_askey@res.raytheon.com          |
---------------------------------------------------




^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Timers in application
  1999-06-08  0:00 Timers in application askeya
                   ` (4 preceding siblings ...)
  1999-06-09  0:00 ` askeya
@ 1999-06-09  0:00 ` Simon Wright
  5 siblings, 0 replies; 9+ messages in thread
From: Simon Wright @ 1999-06-09  0:00 UTC (permalink / raw)


askeya <askeya@res.raytheon.com> writes:

> Any other ideas for timer services I can use?  I need a granularity of
> at least 100 milliseconds, but faster would be better.  I am developing
> in Ada95 but can create interfaces into standard C libs if necessary.

The standard timer resolution on Solaris (SPARC, anyway? -- you don't
say) is 10 mS. In Solaris 2.6 you can change this to 1 mS by a setting
in /etc/system; I think it's

  set hires_tick 1

but mail me at work (see below) for an accurate answer.

The '1' above is a boolean value, by the way, not a count of
milliseconds!

We have had good experiences using this with GNAT and "delay until".

I haven't looked in detail, but I think that behind the scenes GNAT
manages its own list of delays; when a new delay is posted, it checks
the interval against the current remaining interval and
cancels/reposts the system timer if required. Exactly as you will have
to do by hand if you decide not to use the language features.

Personally I would do the tasking/timer stuff in Ada even if I was
using a lot of stuff written in C. I prefer to let someone else worry
about the vagaries of pthreads!

-- 
Simon Wright                        Work Email: simon.j.wright@gecm.com
Alenia Marconi Systems                         Voice: +44(0)1705-701778
Integrated Systems Division                      FAX: +44(0)1705-701800




^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Timers in application
  1999-06-08  0:00   ` James E. Hopper
@ 1999-06-09  0:00     ` dennison
  0 siblings, 0 replies; 9+ messages in thread
From: dennison @ 1999-06-09  0:00 UTC (permalink / raw)


In article <080619991316219725%hopperj@macconnect.com>,
  "James E. Hopper" <hopperj@macconnect.com> wrote:
> Its been several years, but when we needed timers with a flight sim i
> was working on to synchronize the executive, we found ada constructs
> either took to much over head, or did not have sufficient accuracy.
if

In the old Ada83 days, I had similar problems. "delay until" did not
exist, and there's no way to use "delay" for the same purpose without
loosing time. There are ways to use it without *progressivly* loosing
time, but its still inaccurate by the amount of time it takes to
perform the absolute time to delta time calculation (which is not a
constant on a RISC CPU). Since it couldn't be used accuratly for
real-time scheduling anyway, there wasn't much incentive to make "delay"
itself very accurate.

Today with "delay until" around its a completly different story. Of
course you should check your verdor's listed accuracy, but it is quite
likely to be good enough for a 10Hz frequency. Using this for
scheduling, we now have a flight simulation running on vxWorks that we
can currently recompile and run on Win98 laptops with *no* code changes
(and no coditionally compied code). Hooray for Ada95!

Of course at 60Hz we get frame overruns all over the place running under
Win98...

--
T.E.D.


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.




^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Timers in application
  1999-06-08  0:00 Timers in application askeya
                   ` (3 preceding siblings ...)
  1999-06-08  0:00 ` Matthew Heaney
@ 1999-06-09  0:00 ` askeya
  1999-06-09  0:00 ` Simon Wright
  5 siblings, 0 replies; 9+ messages in thread
From: askeya @ 1999-06-09  0:00 UTC (permalink / raw)


"Delay_Until" it is then.  Thanx for all the input and the education.

Andy

askeya wrote:
> 
> I am developing a Solaris 2.6 application (Ada95 with Apex) that needs a
> timer service that allows me to schedule multiple simultaneous wakeups.
> I have looked at "setitimer" and "alarm" man pages, but these services
> appear to only allow one timer per process and/or thread.  Is this
> correct?
> 
> I have read some postings about Posix timers, but can not figure out any
> key words to use for man pages.  Will Posix timers allow multiple
> simultaneous timers?  If so, what man pages can I look at?
> 
> Any other ideas for timer services I can use?  I need a granularity of
> at least 100 milliseconds, but faster would be better.  I am developing
> in Ada95 but can create interfaces into standard C libs if necessary.
> 
> Thanx.
-- 
---------------------------------------------------
|                 Andy Askey                      |
|              Software Engineer                  |
|           Raytheon Systems Company              |
|   670 Discovery Drive, Huntsville, AL  35806    |
|   Phone: (256) 971-2367  Fax: (256) 971-2306    |
|        andrew_j_askey@res.raytheon.com          |
---------------------------------------------------




^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~1999-06-09  0:00 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-06-08  0:00 Timers in application askeya
1999-06-08  0:00 ` dennison
1999-06-08  0:00   ` James E. Hopper
1999-06-09  0:00     ` dennison
1999-06-08  0:00 ` dennison
1999-06-08  0:00 ` David Brown
1999-06-08  0:00 ` Matthew Heaney
1999-06-09  0:00 ` askeya
1999-06-09  0:00 ` Simon Wright

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