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

Re: 12.2: fork() causing getline() to repeat stdin endlessly



On Tue, Oct 24, 2023 at 12:02 PM Max Nikulin <manikulin@gmail.com> wrote:
On 24/10/2023 12:18, tom kronmiller wrote:
> so I unbuffered stdin and that seemed to make it happy.
It might be performance killer. Even fflush(NULL) before fork() may be
better.

In the real program in question, it hardly matters.  It is very heavily compute-bound on inputs which are small.  But flushing() the files seems a better idea in general than unbuffering, so I changed it.  (Still works.)


Reply to: