Re: horrible disk thorughput on itanium

Dan Kegel
2001-12-07T06:41:24Z

Linus wrote:
> >> As far as I can see bonnie++ doesn't use putc_unlocked, but putc.
> >
> >Plain old Bonnie suffered from the same thing. I long ago made it
> >use putc_unlocked() here because throughput was horrible otherwise.
>
> Oh, yeah, blame it on bonnie.
>
> "Our C library 'putc' is horribly sucky"
>
> "Well, then, use something else then".
>
> Isn't somebody ashamed of glibc and willing to try to fix it? It might
> be as simple as just testing a static flag "have I used pthread_create"
> or even a function pointer that gets switched around at pthread_create..

That sounds racy. Better to make the change at compile time, maybe?
Say,

#ifdef __USE_REENTRANT
#define putc(_ch, _fp) _IO_putc (_ch, _fp)
#else
#define putc(_ch, _fp) _IO_putc_unlocked (_ch, _fp)
#endif

That's pedantically safe, I think.

- Dan