comp.lang.ada
 help / color / mirror / Atom feed
From: Simon Wright <simon@pogner.demon.co.uk>
Subject: Re: Native rts not working on linux (glibc)
Date: 1998/11/15
Date: 1998-11-15T00:00:00+00:00	[thread overview]
Message-ID: <x7vaf1sr9ty.fsf@pogner.demon.co.uk> (raw)
In-Reply-To: 72h3gu$lgd$1@nyheter.chalmers.se

d96andgi@dtek.chalmers.se (Anders Gidenstam) writes:

> In article <72evc1$l0$1@nnrp1.dejanews.com>,
> 	dewarr@my-dejanews.com writes:
> > Ada 95 Annex D semantics require run-till-blocked with
> > absolute priority control. The only way to achieve this
> > in Linux is with real time threads under root mode, and
> > yes, of course you can lock up your system this way!
> > 
> > It sounds in any case as though the system is mis-built if
> > you are getting these assertion errors.
> 
> What part of the system? glibc, the compiler or the rts?
> 
> So there isn't anyway to build programs that can be run without root access?
> (On linux, that is... the programs works fine on Solaris)
> (The fsu-rts is rather useless when one task (and therefor the rts) is 
> (almost) always blocked in the 'application main loop' of motif)

Tasking programs will run fine on Linux with GNAT. If they don't there
is something wrong!

As far as I can tell the code that does this is in Set_Priority in s-taprop.adb:

      Result := pthread_setschedparam (T.LL.Thread, SCHED_FIFO, Param'Access);
      pragma Assert (Result = 0 or else Result = EPERM);

If you are root, you get the priority (Result = 0)
If not, the request fails quietly     (Result = EPERM)
.. or something terrible has occurred

The behaviour here is just like that on Solaris (well, at any rate on
the 2.6 we are using).


One thing to be wary of, what glibc are you using? I ask because I
have glibc1 (libc.so.5.4.44) & libpthread 0.71, and that gives
horrible problems with X and Ada tasking; I think it does something to
select(). I put some notes on this at
http://www.pogner.demon.co.uk/gnat-x-threads/ . If you do take this
up, be warned that you will have trouble building X-based programs
(specifically, Emacs!)

-Simon




  reply	other threads:[~1998-11-15  0:00 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-10-28  0:00 Native rts not working on linux (glibc) Anders Gidenstam
1998-10-29  0:00 ` Sune Falck
1998-10-29  0:00   ` Anders Gidenstam
1998-10-29  0:00     ` Anders Gidenstam
1998-11-12  0:00 ` drees
1998-11-12  0:00   ` Anders Gidenstam
1998-11-12  0:00     ` dewarr
1998-11-13  0:00       ` Anders Gidenstam
1998-11-15  0:00         ` Simon Wright [this message]
1998-11-16  0:00           ` Anders Gidenstam
1998-11-16  0:00           ` Anders Gidenstam
1998-11-17  0:00             ` Simon Wright
1998-11-18  0:00               ` Anders Gidenstam
replies disabled

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