comp.lang.ada
 help / color / mirror / Atom feed
* Linux Calls
@ 2003-07-31  0:05 Jeremy Smith
  2003-07-31 19:26 ` Simon Wright
  0 siblings, 1 reply; 3+ messages in thread
From: Jeremy Smith @ 2003-07-31  0:05 UTC (permalink / raw)


I have two tasks, built using gnat 3.13p, running under Linux, Red Hat 8.
The idea was to have one task processing and performing cyclic tasks
continuously while the other task waits for commands and responds to them
right away.  To accomplish this I am want to run the command receipt task at
a higher priority than the continuous processing task.  My problem is that
the commands are coming over an IPC message queue, so when the command
receipt task calls msgget (visible via pragma Import) it blocks but does it
outside the Ada RTS.  The continuous processing task never gains context
because the Ada RTS doesn't know the command receipt task has blocked
pending receipt of the next command.

Anybody know a way to wrap a blocking OS call so that the other lower
priority Ada tasks can play until it returns?

Thanks

Jeremy






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

* Re: Linux Calls
  2003-07-31  0:05 Linux Calls Jeremy Smith
@ 2003-07-31 19:26 ` Simon Wright
  2003-08-01  5:32   ` David Holm
  0 siblings, 1 reply; 3+ messages in thread
From: Simon Wright @ 2003-07-31 19:26 UTC (permalink / raw)


"Jeremy Smith" <jeremy.t.smith@mindspring.com> writes:

> I have two tasks, built using gnat 3.13p, running under Linux, Red Hat 8.
> The idea was to have one task processing and performing cyclic tasks
> continuously while the other task waits for commands and responds to them
> right away.  To accomplish this I am want to run the command receipt task at
> a higher priority than the continuous processing task.  My problem is that
> the commands are coming over an IPC message queue, so when the command
> receipt task calls msgget (visible via pragma Import) it blocks but does it
> outside the Ada RTS.  The continuous processing task never gains context
> because the Ada RTS doesn't know the command receipt task has blocked
> pending receipt of the next command.
> 
> Anybody know a way to wrap a blocking OS call so that the other lower
> priority Ada tasks can play until it returns?

It sounds as though you're using the "fsu" version of the runtime
system - you need the version that uses native threads. On recent
editions of GNAT, & I'm pretty sure on 3.13p, you get a choice between
fsu & native; check out the installation instructions. (as far as I
can remember, it involves switching the symlinks for adainclude,
adalib in ...lib/gcc-lib/i686-pc-linux-gnu/2.8.1/ .

The binary I have is called gnat-3.13p-i686-pc-linux-gnu-bin.tar.gz



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

* Re: Linux Calls
  2003-07-31 19:26 ` Simon Wright
@ 2003-08-01  5:32   ` David Holm
  0 siblings, 0 replies; 3+ messages in thread
From: David Holm @ 2003-08-01  5:32 UTC (permalink / raw)


On 31 Jul 2003 20:26:17 +0100
Simon Wright <simon@pushface.org> wrote:

> "Jeremy Smith" <jeremy.t.smith@mindspring.com> writes:
> 
> > I have two tasks, built using gnat 3.13p, running under Linux, Red Hat 8.
> > The idea was to have one task processing and performing cyclic tasks
> > continuously while the other task waits for commands and responds to them
> > right away.  To accomplish this I am want to run the command receipt task at
> > a higher priority than the continuous processing task.  My problem is that
> > the commands are coming over an IPC message queue, so when the command
> > receipt task calls msgget (visible via pragma Import) it blocks but does it
> > outside the Ada RTS.  The continuous processing task never gains context
> > because the Ada RTS doesn't know the command receipt task has blocked
> > pending receipt of the next command.
> > 
> > Anybody know a way to wrap a blocking OS call so that the other lower
> > priority Ada tasks can play until it returns?
> 
> It sounds as though you're using the "fsu" version of the runtime
> system - you need the version that uses native threads. On recent
> editions of GNAT, & I'm pretty sure on 3.13p, you get a choice between
> fsu & native; check out the installation instructions. (as far as I
> can remember, it involves switching the symlinks for adainclude,
> adalib in ...lib/gcc-lib/i686-pc-linux-gnu/2.8.1/ .
> 
> The binary I have is called gnat-3.13p-i686-pc-linux-gnu-bin.tar.gz

At least with 3.14p and 3.15p you can select the run-time system with --RTS=fsu/native when you
call gnatmake och gnatgcc.

//David Holm



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

end of thread, other threads:[~2003-08-01  5:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-07-31  0:05 Linux Calls Jeremy Smith
2003-07-31 19:26 ` Simon Wright
2003-08-01  5:32   ` David Holm

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