[Top][All Lists]

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

Re: wait_reading_process_ouput hangs in certain cases (w/ patches)

From: Eli Zaretskii
Subject: Re: wait_reading_process_ouput hangs in certain cases (w/ patches)
Date: Mon, 13 Nov 2017 18:10:42 +0200

> Cc: address@hidden
> From: Matthias Dahl <address@hidden>
> Date: Mon, 13 Nov 2017 15:13:28 +0100
> > This is overkill, as the total amount of bytes read by a call to
> > read_process_output cannot exceed 4096, so all we need is an unsigned
> > counter with more than 12 bits. How about making it 'unsigned int'
> > instead? It could even be 'unsigned short', though that might be
> > overkill. Whatever size is chosen, the comment should say that the value
> > recorded is the true value modulo the word size.
> That would not be enough. The counter is for the entire process lifetime
> and not just for a single read back or chain of recursive read backs.

We could reset the value to zero once it's consumed, in which case a
narrower type would be okay.  The price is a slight complication of
the logic.

> Regarding the ISO/IEC commentary, I thought it was worth mentioning here
> since it is an important point to make that not everybody might know.
> But if there is consensus, I will remove the commentary and update the
> if-statement to your version. Eli, what are your thoughts?

Maybe make the comment shorter by just saying that a wrap-around could
happen there in case of overflow.


reply via email to

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