[fpc-devel] pthread scheduler attributes
henry.vermaak at gmail.com
Tue Dec 10 16:42:43 CET 2013
On Tue, Dec 10, 2013 at 02:39:12PM +0100, Sven Barth wrote:
> Am 10.12.2013 12:51 schrieb "Henry Vermaak" <henry.vermaak at gmail.com>:
> > I thought Windows threads always start with the same priority as the
> > process?
> Yes and no. On windows processes have a process class and threads have a
> priority level. Threads inherit the priority class from the process (and
> this can not be changed on a per thread level) and are created with
> priority level THREAD_PRIORITY_NORMAL *within* that priority class.
> Changing the priority level then only changes the priority level *inside*
> the priority class.
> Don't know how good this Windows behavior is approximated on cthreads
> systems though... (and I don't really know wether it's good to approximate
> it :/ )
OK, thanks. I can't think of a straight forward way to abstract the
policies and priorities. Since it's quite a specialised thing to do and
the policy/priority (at least on linux) depends on the system and what
else is running on it, perhaps it's not unreasonable to let the user
write platform specific code for their use case.
Not inheriting the policy/priority on linux is definitely unexpected,
though, I only found out after reading the code in cthreads. Does
anyone agree with me here? Shall I file a bug report?
I'll file a bug report for the leak.
More information about the fpc-devel