First, a disclaimer.  I am a systems newb learning as I go.  Excuse me
if there is some obvious answer I missed.

In chapter 5, section 7 of Unix Network Programming Vol 2, Stevens
says that realtime signals are to be delivered in inverted priority.
That is, lower number signals are to be delivered before higher number
signals (e.g. SIGRTMAX - 1 before SIGRTMAX).  In 1999 (the year UNPV2
was published), when Stevens ran his example program,
rtsignals/test1.c, against Solaris 2.6 he saw two bugs: reversed
priority and LIFO ordering of intra-signal msgs.  Today, I ran the
example program against OmniOS r151010.  I saw correct FIFO ordering
of the msgs but still notice priority inversion:

> rpz@chinaski ~/projects/unpv22e/rtsignals
> $ ./test1
> SIGRTMIN = 42, SIGRTMAX = 73
> sent signal 73, val = 0
> sent signal 73, val = 1
> sent signal 73, val = 2
> sent signal 72, val = 0
> sent signal 72, val = 1
> sent signal 72, val = 2
> sent signal 71, val = 0
> sent signal 71, val = 1
> sent signal 71, val = 2
> rpz@chinaski ~/projects/unpv22e/rtsignals
> $ received signal #73, code = -2, ival = 0
> received signal #73, code = -2, ival = 1
> received signal #73, code = -2, ival = 2
> received signal #72, code = -2, ival = 0
> received signal #72, code = -2, ival = 1
> received signal #72, code = -2, ival = 2
> received signal #71, code = -2, ival = 0
> received signal #71, code = -2, ival = 1
> received signal #71, code = -2, ival = 2

According to POSIX.1-2008 the realtime signals should be delivered
lowest first.  I wanted to check POSIX.1-2001 but apparently I need to
register to view that.  I'm going to make the possibly faulty
assumption that the original realtime extensions had the same
statement.

> When multiple unblocked signals, all in the range SIGRTMIN to SIGRTMAX, are 
> pending, the behavior shall be as if the implementation delivers the pending 
> unblocked signal with the lowest signal number within that range. No other 
> ordering of signal delivery is specified.

http://pubs.opengroup.org/onlinepubs/9699919799/functions/V2_chap02.html#tag_15_04_02

I haven't run this program on any other platforms yet, but in the book
Stevens gets the correct behavior against Digital Unix 4.0B.  Is this
just a long standing bug in Solaris/Illumos?

-Z



-------------------------------------------
illumos-discuss
Archives: https://www.listbox.com/member/archive/182180/=now
RSS Feed: https://www.listbox.com/member/archive/rss/182180/21175430-2e6923be
Modify Your Subscription: 
https://www.listbox.com/member/?member_id=21175430&id_secret=21175430-6a77cda4
Powered by Listbox: http://www.listbox.com

Reply via email to