tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: [PATCH] Re: sharing mutex between libc stub and libpthread

On Sat, 23 Feb 2013, Emmanuel Dreyfus wrote:

Emmanuel Dreyfus <> wrote:

Here is a third approach: if program is not linked with -lpthread, the
libpthread implementation falls back to libc stubs:

Here is a complete and cleaned up patch:

I checked it still passes all libpthread tests, and it also passes the
new dlopen tests I posted earlier. On the performance front, I ran two
tests to evaluate the hit:

100 million free(malloc(1024)): slowdown 2%
without the patch: mean 27.36s, 106 samples, sd 0.48
with the patch: mean 28.04s, 245 samples, sd 0.25

100 million gmtime(&now): slowdown not significant
without the patch: 49,15s, 34 samples, sd 0.35
with the patch, 48.55s, 51 samples, sf 0.50

By my quick calculations, that's a 1.2% difference. While not substantial, it seems significant to me.

| Paul Goyette     | PGP Key fingerprint:     | E-mail addresses:       |
| Customer Service | FA29 0E3B 35AF E8AE 6651 | paul at    |
| Network Engineer | 0786 F758 55DE 53BA 7731 | pgoyette at |
| Kernel Developer |                          | pgoyette at  |

Home | Main Index | Thread Index | Old Index