lua-users home
lua-l archive

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


On Fri, Oct 1, 2010 at 11:59 AM, Fredrik Widlund
<fredrik.widlund@qbrick.com> wrote:
> function main(arg)
> local sensors = {}
> local x = 0
> local linda = lanes.linda()
> lanes.timer(linda, "timer", 0, 0.02)
> local lane = lanes.gen("*", sensor)
> while true do
> local time, message = linda:receive("timer")
> sensors[x] = lane(x)
> x = x + 1
> end
> end

Obviously the problem is that the lanes are not being garbage
collected. In fact, from this code, you can see that the lanes are all
referenced in the sensors table, so they will never be collected. What
happens if you just let them go?

steve d.