Subject: Re: pthreads plan
To: Michael Graff <email@example.com>
From: Charles M. Hannum <firstname.lastname@example.org>
Date: 11/06/1999 11:36:36
Michael Graff <email@example.com> writes:
> Greg Hudson <ghudson@MIT.EDU> writes:
> > I think the major sticking point is getc() and putc(), which need to
> > be (a) fast in normal programs, and (b) MT-safe in pthreads programs.
> > You can get the overhead for normal programs down to a single
> > condition check by introducing a global flag which gets set when the
> > first thread is created.
> What about something like this?
> _getc(): no multithreaded support
> _getc_MT(): locking
> and in the header file:
> #if defined(_REENTRANT)
> rename(getc, _getc_MT);
> rename(getc, _getc);
That doesn't really help, since getc() is a macro.