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

Re: [MiNT] vim slow

On 30/09/14 12:28, Miro Kropáček wrote:

On Tue, Sep 30, 2014 at 12:00 PM, Alan Hourihane <alanh@fairlite.co.uk> wrote:
Does this patch fix things for you Vincent ?

I may be wrong here but I think this patch is not correct. If the timeout value is != 0 and there is no data, we continue to the code below:

                if (timeout && !t)
                        t = addtimeout (p, (long)timeout, unselectme);
                        timeout = 0;

and in the next iteration (descriptor) you'll terminate even though you should wait & retry. Whole function / loop is a dirty mess, several examples of terrible programming practices.

There is no next iteration because there's only one timeout, which would have already occurred, so the retry after collision code shouldn't try to wait again, otherwise you'd be doubling the timeout, and then tripling and so on. This code is heavily based on the old select code.

There are plenty of places in the FreeMiNT code which is a mess. Feel free to submit patches.