This is the mail archive of the
cygwin-patches
mailing list for the Cygwin project.
Re: [PATCH] pthread_getattr_np, pthread_setschedprio
- From: Christopher Faylor <cgf-use-the-mailinglist-please at cygwin dot com>
- To: cygwin-patches at cygwin dot com
- Date: Thu, 14 Apr 2011 23:42:46 -0400
- Subject: Re: [PATCH] pthread_getattr_np, pthread_setschedprio
- References: <1302489035.4944.20.camel@YAAKOV04> <1302836432.5296.7.camel@YAAKOV04>
- Reply-to: cygwin-patches at cygwin dot com
On Thu, Apr 14, 2011 at 10:00:32PM -0500, Yaakov (Cygwin/X) wrote:
>On Sun, 2011-04-10 at 21:30 -0500, Yaakov (Cygwin/X) wrote:
>> This patch adds two pthread functions which appear to be "low-hanging
>> fruit".
>>
>> pthread_setschedprio(3) is a POSIX function[1][2] which changes the
>> scheduling priority for the given thread. It is similar to
>> pthread_setschedparam(3) but does not change the scheduling policy and
>> doesn't require the priority to be wrapped in a struct.
>>
>> pthread_getattr_np(3) is a GNU extension[3] which initializes the given
>> pthread_attr_t with the actual attributes of the given thread. While
>> the example code does not have the pthread_attr_t pre-initialized by
>> pthread_attr_init(3), I have seen real world code where it is, so either
>> possibility is handled.
>
>After further analysis, I should work further on pthread_getattr_np() in
>conjunction with adding pthread_attr_getstack(), both of which I need
>for webkitgtk-1.3.13. But it will be a couple of weeks before I'll have
>the time to get to that.
>
>So for now, lets just implement pthread_setschedprio(), which looks
>pretty straight-forward and is unrelated to the others. Revised patch
>attached.
Looks ok. Please check in.
Thanks.
cgf