lua-users home
lua-l archive

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


On Fri, Mar 16, 2012 at 5:06 PM, Thijs Schreijer
<thijs@thijsschreijer.nl> wrote:
>> even on localhost, using UDP for messaging has a perceptible overhead.
> I'm aware of that, but for my use its network centric, so 1 additional UDP packet won't be my biggest performance issue.

ok, if the overhead is fine to your needs then no need to worry.



> 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.

in HTT, i defined simple thread-safe FIFO queues accessible from both
C and Lua.  i think that part could be easily adapted to your problem.

cheers,

-- 
Javier