lua-users home
lua-l archive

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



You don't need to dive into OS specific issues, at all. Threads share a common address space, so all you have to do is serialize Lua data structures into a stream (allocated char array), deserialize it in the other thread. I would definately see a need for this + basic thread creation (portable) + lazy evaluation, all together in an easy to use package.

DBUS, sockets etc. can be done using similar approach, but they'd be useful only if
- communicating with existing non-Lua services
- communicating across process boundaries (another CPU)


gary ng kirjoitti 8.2.2007 kello 9.25:

Hi,

Since lua don't have thread support out of the box,
the alternative would be spawning multiple small lua
process if I want some form of multi tasking(I know
there is coroutine but let's say that coroutine
doesn't fit the scenario).

How would I have a simple efficient way of
bi-directional communication between two lua process ?
On, unix platform, using domain socket seems to be
easiest(though I am not sure if luasocket supports it
and I was told that there is no such a thing on
Windows). popen() only creates a one way pipe.

Or must I fallback to the 127.0.0.1 interface ? I see
two problems with that, security and unnecessary
payload(the network layer). Though it has the
advantage that it is network ready by design.

What I want is a relatively portable way(mainly *nix
and Windows) for this need.

regards,



______________________________________________________________________ ______________
The fish are biting.
Get more visitors on your site using Yahoo! Search Marketing.
http://searchmarketing.yahoo.com/arp/sponsoredsearch_v2.php