#4696 closed bug (fixed)
sched.h is missing struct sched_param
Reported by: | mvfranz | Owned by: | nobody |
---|---|---|---|
Priority: | normal | Milestone: | R1 |
Component: | System/POSIX | Version: | R1/alpha1 |
Keywords: | Cc: | ||
Blocked By: | Blocking: | ||
Platform: | All |
Description
To work with posix threads struct sched_param must be defined. /boot/develop/headers/posix/sched.h is missing this definition.
adding : struct sched_param { int sched_priority; };
is all that is needed. It seems that the spec only defines one field. Any others are platform specific.
Attachments (1)
Change History (9)
comment:1 by , 15 years ago
Component: | System → System/POSIX |
---|
comment:2 by , 15 years ago
comment:3 by , 15 years ago
That reference must be newer than my O'reilly pthreads book. We should add everything that is required.
I am working on some other functions that require this structure to have sched_priority defined (pthread_attr_getschedparam and pthread_attr_setschedparam). If there are others on the list, I can take a look. For now, I am just trying to get the missing functions needed for GCJ to compile and run.
by , 15 years ago
Attachment: | pthread.diff.gz added |
---|
Patches for sched.h and pthreads to allow setting of the thread priority
comment:4 by , 15 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Cleaned and applied in hrev33783.
follow-up: 7 comment:5 by , 15 years ago
Sorry but I don't agree with the values returned by sched_get_priority_*()... see: http://www.opengroup.org/onlinepubs/007908775/xsh/sched.h.html http://www.opengroup.org/onlinepubs/007908775/xsh/sched_get_priority_min.html IMO they should only be those part of the scheduling class (1-99 for other, 100-120 for FIFO, and btw is RR support mandatory ? as for now the BeOS classes don't include anything alike).
follow-up: 8 comment:6 by , 15 years ago
Thanks for your patch! However, please don't zip/gzip patches unless they don't fit otherwise, and take more care about our coding style. Especially the indenting was messed up.
comment:7 by , 15 years ago
Replying to mmu_man:
IMO they should only be those part of the scheduling class (1-99 for other, 100-120 for FIFO, and btw is RR support mandatory ? as for now the BeOS classes don't include anything alike).
What we have is more or less RR (round-robin). Anyway, I wouldn't use real time priorities unless the code that uses this class is actually aware of that - it isn't really documented that way. This would require a bit more investigation.
comment:8 by , 15 years ago
Replying to axeld:
Thanks for your patch! However, please don't zip/gzip patches unless they don't fit
otherwise, and take more care about our coding style. Especially the indenting was messed up.
I tried to follow what was already in the file. I guess my tabs were set wrong.
According to http://www.opengroup.org/onlinepubs/9699919799/basedefs/sched.h.html#tag_13_39 there are a few more fields this structure shall have.
In any case, I'm not sure why this structure should be defined, as the functions that work with it aren't available either.