Re: POSIX rwlocks vs. glib2 rwlocks
- From: Sebastian Wilhelmi <wilhelmi ira uka de>
- To: Erik Walthinsen <omega temple-baptist com>
- Cc: gtk-devel-list <gtk-devel-list gnome org>
- Subject: Re: POSIX rwlocks vs. glib2 rwlocks
- Date: Wed, 20 Jun 2001 10:55:16 +0200
Hi Erik,
> While investigating the g_type_instance_is_a() performance problem, I
> looked into how rwlocks are done in glib2. I was surprised to learn
> that there is no implementation of rwlocks that uses the pthread
> functions that implement this primitive. glibc-2.2 has rwlocks fully
> implemented from what I can see in the library and headers (though I
> haven't confirmed that they are fully functional, I would assume so),
> and I have little doubt that they're faster than the routines currently
> in glib.
I made a test program, and here are the results for 1000000 locks and unlocks.
GLib Reader locks: 2.6676460000s
GLib Writer locks: 2.6764440000s
PThread Reader locks: 2.8518880000s
PThread Writer locks: 2.5612170000s
So I think we can continue using out home brewed version. The point in not
using the pthread version is, that our thread system is fully replaceable by a
user provided implementation. That would mean to either
1) let rwlocks not be replaceable or
2) add those 8 functions to the already fat GThreadFunc vector
Both options are not that nice for a dubious win.
Bye,
Sebastian
--
Sebastian Wilhelmi
mailto:wilhelmi ira uka de
http://goethe.ira.uka.de/~wilhelmi
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]