Opened 10 years ago

Closed 10 years ago

Last modified 10 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:
Has a Patch: no 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 10 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 Changed 10 years ago by mmadia

Component: SystemSystem/POSIX

comment:2 Changed 10 years ago by axeld

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 Changed 10 years ago by mvfranz

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.

Changed 10 years ago by mvfranz

Attachment: pthread.diff.gz added

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

comment:4 Changed 10 years ago by korli

Resolution: fixed
Status: newclosed

Cleaned and applied in hrev33783.

comment:5 Changed 10 years ago by mmu_man

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 Changed 10 years ago by 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.

comment:7 in reply to:  5 Changed 10 years ago by axeld

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 in reply to:  6 Changed 10 years ago by mvfranz

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.