SetThreadPriority

SetThreadPriority

Win32 applications can change the priority of their threads at any point in their execution. This is not currently supported under Linux because it opens the possibility of a DoS attack.

MikeHearn has implemented support for this based on POSIX capabilities, when suid root the wineserver will acquire CAP_SYS_NICE then drop privs. This makes the UNIX privilege model Win32 compatible. The patch is Implement SetThreadPriority

For more information on this topic, read this thread: http://www.winehq.org/pipermail/wine-devel/2005-April/035563.html

It seems that the rlimit patch went into the kernel. From LWN: The patch creates two new resource limits. RLIMIT_NICE controls the maximum "niceness" that the process can set for itself in the normal timesharing scheduler. The limit has a range of 0..39, with 39 corresponding to an internal niceness value of -20 - the highest priority. [...] The other limit is RLIMIT_RTPRIO; it can have a range of 0..100. If it is nonzero, the process is empowered to use the realtime scheduling classes up to the indicated priority. More on the patch here: http://www.steamballoon.com/wiki/Rlimits. Can we maybe use this to support thread priorities?

SetThreadPriority (last edited 2008-05-03 04:08:04 by nathan.n)