Bug#637654: libglib2.0-dev: glib programs can'T be run with realtime priority (or any non-SCHED_OTHER regime)

Simon McVittie smcv at debian.org
Mon Jan 16 15:22:49 UTC 2012

forwarded 637654 https://bugzilla.gnome.org/show_bug.cgi?id=667651
retitle 637654 libglib2.0-dev: g_thread_create() causes a fatal error under realtime scheduling
tags 637654 + patch

On Sat, 13 Aug 2011 at 15:27:42 +0200, Marc Lehmann wrote:
> GThread-ERROR **: file /tmp/buildd/glib2.0-2.28.6/./gthread/gthread-posix.c: line 348 (g_thread_create_posix_impl): error 'Invalid argument' during 'pthread_attr_setschedparam (&attr, &sched)'

The actual bug here is that g_thread_create() and g_thread_create_full()
attempt to change the thread's priority, and then implement it wrong: they
either crash (under realtime scheduling) or have no effect (otherwise).
This was independently found in Maemo, and I've forwarded it upstream
as GNOME#637654.

This bug no longer exists in GLib 2.31, where the concept of thread priorities
has been deprecated, and GLib never actually changes a thread's priority.

My proposed solution is for 2.30 to not change new threads' scheduling
policy or priority either, because on Unix that functionality has never
actually worked - policy and priority were always inherited. See the upstream
bug for details.


More information about the pkg-gnome-maintainers mailing list