Thread Safety
H . J . Lu
hjl@lucon.org
Mon Jul 24 16:06:00 GMT 2000
On Mon, Jul 24, 2000 at 06:57:46PM -0400, Vermont Rutherfoord wrote:
> On Sun, Jul 23, at 09:57AM(-0700), H . J . Lu wrote:
> >
> > When you use putc/putchar, the lock is checked at the RUNTIME. That
> > is where the overhead comes from. In fact, putc/putchar will call
> > lock and then unlock. Without -lpthread, they are just empty functions.
> > But there is still overhead for calling empty functions. If you don't
> > want overhead, use putc_unlocked/putchar_unlocked.
> >
>
> Is there any thought of providing a more transparent way to support
> threadedness? As it is, I cringe to think that the basic libc i/o
> functions are suffering a slowdown, which could significantly affect
> interactivity of a i/o heavy system. What happened to the thought of
> leaving thread safety turned off unless REENTRANT is defined?
You have to ask it on the glibc mailing list.
H.J.
More information about the Libc-hacker
mailing list