Subject: Re: pthreads plan
To: Greg Hudson <firstname.lastname@example.org>
From: Giles Lean <email@example.com>
Date: 11/07/1999 05:31:14
On Sat, 06 Nov 1999 10:44:45 -0500 Greg Hudson wrote:
> If possible, it would be really neat to avoid the situation where
> there are threaded objects and non-threaded objects, and never the
> twain shall meet.
I concur. Avoiding support questions about having to recompile code
with _REENTRANT is a worthy goal.
> 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.
I would prefer this, if the performance impact is acceptable.
Library implementors still have to be very careful not to make
assumptions that a program is not threaded just because Right Now it
is only single threaded.