[PATCH] pthread_getattr_np, pthread_setschedprio

Yaakov (Cygwin/X) yselkowitz@users.sourceforge.net
Fri Apr 15 03:00:00 GMT 2011


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.


Yaakov

-------------- next part --------------
A non-text attachment was scrubbed...
Name: pthread_setschedprio.patch
Type: text/x-patch
Size: 3718 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin-patches/attachments/20110415/e9c28b88/attachment.bin>


More information about the Cygwin-patches mailing list