lua-users home
lua-l archive

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

I'm working on a scripting engine (Nmap's NSE) that yields a thread
while waiting on network I/O. The engine will hold the thread until a
callback from the network I/O library, while another thread is
executing, places the yielded thread back into the running queue while
leaving the necessary arguments on the stack for lua_resume. My
question is: what can we safely do while using that thread inside the
callback function. If a memory error (or any error) is encountered
while putting the items on the stack for lua_resume, what should
happen? Further, is it safe to push a function and make a protected
call on the yielded thread? Is there a better/safer approach to this?


-Patrick Donnelly

"One of the lessons of history is that nothing is often a good thing
to do and always a clever thing to say."

-Will Durant