lua-users home
lua-l archive

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


Hi,

> I don't insist that it is not a bug. It may well be a bug. I do
> not program against the winsock stack, anyway.

Sigh... :) Wasn't the comment in the manual specific to WinSock?

> All I said was that I did not believe that you could, in general,
> know that a send() would not return EWOULDBLOCK (or, alternatively,
> block) even though select() said it was writable.

But I know that! If you check the LuaSocket code, you will see that
this is tested for in the Unix version. The Windows code has also been
worked around.

All I am saying is that, in Windows, the select will return writable,
then you try to write, it says it would block, then you select again, it
tells you it's writable, and try to write, and it fails again and so on
and so forth, nothing in between, no other threads. It's a bug.
Sometimes it throws CPU usage to the skies, sometimes it doesn't.

    http://support.microsoft.com/default.aspx?scid=kb;en-us;177346
    http://tangentsoft.net/wskfaq/newbie.html

They claim it doesn't happen in NT 4.0. Might happen even if they claim
it doesn't. It doesn't matter, the code has to be prepared to see this
happening anyways.

And users of LuaSocket have to be aware of the possibility of busy wait
when they run their programs on Windows because select just doesn't
work.  There is nothing I can do about it short of writing a worm to
infect everybody's computer and patch this bug.

Regards,
Diego.