On Sat, May 27, 2006 at 06:36:15PM +0300, Marko Kreen wrote:
> >ISTM that in a single-threaded application such as the backend,
> >it should be libc's responsibility to avoid such overhead, not
> >ours.
>
> Obviously, except glibc guys seems to be philosophically
> opposed to this, so apps need to work around it.
>
> AFAIK at least *BSDs have got this right, don't know
> about others.
Given there is no way to know if you're running single threaded or not,
I don't think glibc can take chances like that.
In any case, this isn't the issue here. Glibc doesn't do any locking
unless pthread is linked in. Ofcourse, it takes a few cycles to
determine that, but I don't think that'd cause a major slowdown.
Have a nice day,
--
Martijn van Oosterhout <kleptog@svana.org> http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.