Wed, 18 Aug 1999 18:37:57 -0400
At 02:49 PM 8/18/1999 -0700, Mark Lundquist wrote:
>The thread scheduler runs in user space on Solaris. The contention
>scope of an "unbound" thread is intra-process. pthread_setschedparam()
>is only used on unbound threads -- it has no effect on a thread that is
>bound to an LWP. Scheduling parameters for LWPs are manipulated using
>priocntl(2) on Solaris -- and there, there are indeed rules about
>priority changes that require super-user privileges.
There is what the manual says, and what the reality is. The problem is in changing priorities in native threads and Solaris will indeed return silently whether or not the program is run as root, and as I recall there are a lot of things you need to set up in configuring Solaris for all priority changes to perform as expected. You can't just run a program using native threads on a Solaris 2.6 system and get the expected behavior, whatever that is.
This does not say that you can't do real-time programming on Solaris, just that whether or not you run as root is a small detail. (But this has to count as a 1.1.3(6) issue. If it were possible to warn the user that setting the priority failed or would fail, it would be nice to do so. However, the testing required to determine whether or not changing priorities has any effect is certainly "impossible or impractical...given the implementation's execution environment."
I'd explain further, but spend a few days running Heartstone and you will see what I mean.
>> The way GNAT works is that if you aren't root then your tasks' OS
>> priorities are normal (on Solaris, in the time sharing class); if you
>> /are/ root then your tasks' OS priorities are real-time (in the real
>> time dispatching class).
>The scheduling policy classes on Solaris -- realtime and time-sharing
>-- have to do with LWPs, not threads. Your comments suggest that maybe
>what GNAT has done is to exclusively use bound threads (and create one
>LWP to serve each thread?)
>Anyway... these pthreads details are parenthetical. (If I hadn't
>overreached in my reply to Roger, saying that I couldn't even _believe_
>you had to be root to change a thread priority, it wouldn't have come
>Senior Software Engineer
>Development Solutions Business Unit
>UNIX Suites Group
>Aloha, OR, USA
Robert I. Eachus
function Message (Text: in Clever_Ideas) return Better_Ideas is...