Current-Users archive

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

Re: Weirdness in comm(1)

On Sat, Nov 28, 2009 at 05:03:28AM +0700, Robert Elz wrote:
> Why getc_unlocked() - I see nothing in getline(3) (aka getdelim(3))
> that indicates either that the function is not thread safe, nor that
> the stream paramater must be locked before the call, but that's what
> use of getc_unlocked() implies doesn't it?   I assume you just accidentally
> omitted the flockfile() stuff that would be required to use it safely?

Avoids the locking overhead for each character. The application here is
single threaded and the program I use it for too. That doesn't mean they
might not pull in pthread somehow...


Home | Main Index | Thread Index | Old Index