lua-users home
lua-l archive

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


> > The library gets started, and creates its own threadpool, so not
> controllable from my code/the Lua state, and then calls a callback
> using one of those workerthreads.
> > Also in this case, qtwebkit downloading and rendering, then 1
> additional udp packet shouldn't result in a performance issue.
> > Unless the helper threads kit provides a way around this?
> 
> no, the toolkit wasn't thought for this usecase, it's intended to be
> used when you want to add some threads to wait on external events
> without having to delve too deep on threading issues.
> 
> i just pointed you there because the specific problem you're solving
> (communicating between several threads and a single Lua State) is the
> same i had already solved there, so you might want to read how i
> managed it.

I went through the code, you clearly gave the queue more thought than I did :). But accessing it is only the smaller part of the problem. The biggest issue for me is the notification (to the Lua state) that some data has been pushed into the queue. I am worried about resources there, preventing busy-wait or short timeout polling, hence waking up a select() with a UDP packet.
Is there a better way to do this?