lua-users home
lua-l archive

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


On Wednesday 12 January 2005 11:52 am, Diego Nehab wrote:
> > BTW, the LuaThreads package seems to be outdated, i had to tweak it to
> > get to compile with Lua5.0.2, is there a newer version? or is it
> > deprecated?
>
> I have an updated version. Will be released soon.

i'm still working with luaThreads, under 5.02... and have a problem, 
apparently garbage collection doesn't work.  might it be because of the 
version mismatch between luaThreads and Lua itself?

i have this code, runnin under a thread

 local f = io.open (path, "rb")
 if not f then
  return http_404 (req, res)
 end
 
 local fsize = f:seek ("end")
 f:seek ("set")
 res.headers["Content-Length"] = fsize
 repeat
  block = f:read (8192)
  if block then
   http_send_res_data (res, block)
  end
 until not block
 f:close ()

and it dies (the whole process, not just the thread) as soon as garbage 
collection is fired (in my case is the 9th time in the loop)

-- 
Javier

Attachment: pgphG6pyrWhv2.pgp
Description: PGP signature