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.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,f00f4307a7546bf1 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newscon06.news.prodigy.com!prodigy.net!newsfeed-00.mathworks.com!nntp.TheWorld.com!not-for-mail From: Robert A Duff Newsgroups: comp.lang.ada Subject: Re: Ada Task Priorities (Windows vs Linux) Date: 12 Apr 2006 13:08:36 -0400 Organization: The World Public Access UNIX, Brookline, MA Message-ID: References: <1144855455.401847.282300@i40g2000cwc.googlegroups.com> NNTP-Posting-Host: shell01.theworld.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: pcls4.std.com 1144861716 4500 192.74.137.71 (12 Apr 2006 17:08:36 GMT) X-Complaints-To: abuse@TheWorld.com NNTP-Posting-Date: Wed, 12 Apr 2006 17:08:36 +0000 (UTC) User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 Xref: g2news1.google.com comp.lang.ada:3797 Date: 2006-04-12T13:08:36-04:00 List-Id: "AAFellow@hotmail.com" writes: > Hi Everyone, > > How are tasks prioritized in Ada when running on Linux (compared to > Windows). I wrote a small test program that I ran in Windows, and it > seems that the higher the number that I set the task's priority to, the > higher the priority that is given to that task (I thought the opposite > was true?) In Ada, higher numbers mean higher priority. > In Linux (using GNAT complier), how are the priorities mapped? I know > a lower number means a higher priority, with a range of -20 to 19 and a > default of 0. Do we just use these same numbers in the Ada code when > setting the priorities of the tasks? No. You use the numbers in the range System.Priority (or sometimes, System.Interrupt_Priority). The default is System.Default_Priority. Look at the source code for package System to see what the numbers are. The Ada run-time system will map these numbers to whatever the operating system uses. If the operating system thinks lower numbers mean higher priority, then the Ada run-time system will take that into account. > Also, (so we can verify we have set the priorities correctly) does > Linux provide a way to actually see what priority the OS has given to > tasks that the Ada code has started? Are there any tools availible > that can do this? I think the 'top' program will show such info. Not sure. - Bob