bug-glibc
[Top][All Lists]
Advanced

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

single threaded performance enhancement


From: Padraig Brady
Subject: single threaded performance enhancement
Date: Mon, 26 Nov 2001 13:45:32 +0000
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.6) Gecko/20011120

For single threaded programs/libraries using the
_unlocked versions of the stdio functions provide
very big performance gains. So why aren't these selected
by default #ifndef _REENTRANT, as this must be defined
for all multithreaded apps?

I.E. why isn't the following in <stdio.h> ?

#ifdef __USE_MISC
#ifndef _REENTRANT
#   undef clearerr
#   define clearerr(x) clearerr_unlocked (x)
#   undef feof
#   define feof(x) feof_unlocked (x)
#   undef ferror
#   define ferror(x) ferror_unlocked (x)
#   undef fflush
#   define fflush(x) fflush_unlocked (x)
#   undef fgets
#   define fgets(x,y,z) fgets_unlocked (x,y,z)
#   undef fputc
#   define fputc(x,y) fputc_unlocked (x,y)
#   undef fputs
#   define fputs(x,y) fputs_unlocked (x,y)
#   undef fread
#   define fread(w,x,y,z) fread_unlocked (w,x,y,z)
#   undef fwrite
#   define fwrite(w,x,y,z) fwrite_unlocked (w,x,y,z)
#   undef getc
#   define getc(x) getc_unlocked (x)
#   undef getchar
#   define getchar() getchar_unlocked ()
#   undef putc
#   define putc(x,y) putc_unlocked (x,y)
#   undef putchar
#   define putchar(x) putchar_unlocked (x)
#endif
#endif

cheers,
Padraig.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]