lua-users home
lua-l archive

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


On Wed, Oct 29, 2003 at 12:11:05AM -0500, Diego Nehab wrote:
> > This makes me wonder if LuaSocket doesn't play well when signals are
> > thrown into the mix.  Has anybody else had similar issues with
> > LuaSocket?  I'm told there's a whole world of pain when you start
> > mixing
> > signals and select() - are there any plans to let LuaSocket use poll()
> > in any newer versions?  (Even if they're only for Lua 5)
> 
> From the top of my head, I don't remember reading anything against
> using select with signals. If you could give me more hints about what
> could happen, I would be happy to discuss possible solutions with you.

the classic select/signal (and poll/signal) issue is atomically waiting
for a signal or file descriptor event, although that doesn't seem to be
the problem here.

one thing i noticed in usocket.c is that it doesn't check for EINTR
after write(), sendto(), read(), recvfrom() etc. ?  the usual trick is
to loop while you get EINTR:

	do
		ret = write(...);
	while(ret < 0 && errno == EINTR)

-taj