From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,b180fbb5257e142f X-Google-Attributes: gid103376,public From: Simon Wright Subject: Re: Native rts not working on linux (glibc) Date: 1998/11/15 Message-ID: #1/1 X-Deja-AN: 412151716 X-NNTP-Posting-Host: pogner.demon.co.uk:158.152.70.98 References: <717sfl$ple$1@nyheter.chalmers.se> <72e20a$8h5$1@nnrp1.dejanews.com> <72egna$6na$1@nyheter.chalmers.se> <72evc1$l0$1@nnrp1.dejanews.com> <72h3gu$lgd$1@nyheter.chalmers.se> X-Complaints-To: abuse@demon.net X-Trace: news.demon.co.uk 911161022 nnrp-11:21318 NO-IDENT pogner.demon.co.uk:158.152.70.98 Organization: At Home Newsgroups: comp.lang.ada Date: 1998-11-15T00:00:00+00:00 List-Id: 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