Skip to content
Commit 49b59e5a authored by Allison Karlitskaya's avatar Allison Karlitskaya
Browse files

GLib: implement GMutex natively on Linux

If we have futex(2) then we can implement GMutex natively and gain a
substantial performance increase (vs. using pthreads).

This also avoids the need to allocate an extra structure in memory when
using GMutex or GCond: we can use the structure directly.

The main reason for the increase in performance is that our
implementation can be made more simple: we don't need to support the
array of options on pthread_mutex_t (which includes the possibility, for
example, of being recursive).

The result is a ~30% improvement in uncontended cases and a much larger
increase (3 to 4 times) in contended cases for a simple testcase.

https://bugzilla.gnome.org/show_bug.cgi?id=731986
parent be0b9211
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment