lua-users home
lua-l archive

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


Hi!

2014-04-06 1:25 GMT+02:00 Rena <hyperhacker@gmail.com>:
> On Sat, Apr 5, 2014 at 4:14 PM, Sean Conner <sean@conman.org> wrote:
>>
>> It was thus said that the Great Tim Hill once stated:
>> >
>> > On Apr 5, 2014, at 10:25 AM, Rena <hyperhacker@gmail.com> wrote:

>> > > Of course one thread can't touch another thread's Lua state, since a
>> > > state can only be used by one thread at a time. So we need to store
>> > > the
>> > > received messages somewhere until the receiving thread asks for them.

>> > > [...]

> Thanks for the feedback everyone. I'm just going to go ahead and accept the
> potential performance hit of an extra copy in exchange for how much simpler
> it makes the code.

Yes, your first thoughts on the problem sound quite complicated. If
you want to do message passing between threads, consider ready-to-copy
designs that just work, instead of fiddling yourself with mutexes and
the like. I've tried ZeroMQ recently for similar problems with
acceptable success
(nanomsg as its "successor" has already been mentioned).

Regards,
Matthias