Opened 15 years ago

Closed 15 years ago

Last modified 15 years ago

#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)

pthread.diff.gz (836 bytes ) - added by mvfranz 15 years ago.
Patches for sched.h and pthreads to allow setting of the thread priority

Download all attachments as: .zip

Change History (9)

comment:1 by mmadia, 15 years ago

Component: SystemSystem/POSIX

comment:2 by axeld, 15 years ago

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.

comment:3 by mvfranz, 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 mvfranz, 15 years ago

Attachment: pthread.diff.gz added

Patches for sched.h and pthreads to allow setting of the thread priority

comment:4 by korli, 15 years ago

Resolution: fixed
Status: newclosed

Cleaned and applied in hrev33783.

comment:5 by mmu_man, 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).

comment:6 by axeld, 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.

in reply to:  5 comment:7 by axeld, 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.

in reply to:  6 comment:8 by mvfranz, 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.

Note: See TracTickets for help on using tickets.