Hi Christos, hi Charles and all, > Sent: Thursday, August 04, 2016 at 9:12 AM > From: "Christos Zoulas" <christos%zoulas.com@localhost> > To: "Rocky Hotas" <rockyhotas%post.com@localhost> > Cc: "Charles Cui" <charles.cui1984%gmail.com@localhost>, "tech-userlevelnetbsd.org" <tech-userlevel%netbsd.org@localhost> > Subject: Re: sched_protect(2) [...] > > | I intentionally wrote nothing in the section DESCRIPTION (where the integer value sched_priority is described). Do you prefer to insert something even there, instead? > > I don't know, I did not either. In the attached file I wrote a couple of lines there, because I think it is useful for the reader: Note that this number has also an allowed negative value (see description of .Fn sched_protect below)." > Yes, it is preferable to have them sorted but I did not do that yet. I tried > to explain what popping a level means though... I had tried yesterday to sort them. But (after reflecting a little bit) I think in the original order they are more "readable". For example, functions like sched_setparam and sched_setparam are one before the other and it is very useful. In an alphabetical order, sched_getparam would be 1st and sched_setparam would be 7th! > Yes, this has been already done. I've ameneded the page, thanks! Ok for the links! I would like to make a couple of observations if they could be useful: - The man page contains description of two functions (sched_setaffinity_np and sched_getaffinity_np) that are not mentioned in the NAME section. If it is not intentional, they should be added even there. - Christos, you made a great description about "popping" a level. Anyway, from the manual it is not clear if sched_protect with a positive argument increases by one the protected priority of the thread (regardless of the actual value of the argument), or if it increase that priority by the argument instead. In other words, if I call sched_protect(5) and then sched_protect(4), I don't know from the manual if I then should call sched_priority(-1) 9 times in order to restore the original thread priority, or just 2 times, because I called sched_protect two times, regardless of the positive argument. (This is just a consideration; if it is trivial for a programmer to determine the answer, discard this point :)!) Thanks to you; my work was not so big. Bye :) Rocky
Attachment:
sched.3
Description: Binary data