lua-users home
lua-l archive

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


Unless you are running a huge number of different drivers at once even embedded hardware should be able to run enough threads or processes for isolation. I would build a prototype of how many you might want and check the memory usage. It is the only really reliable way of running untrusted code in general. The other option is to to code analysis and work out that the code must terminate and does not use too much memory, which you might be able to do in a limited domain, depending what the drivers need to be able to do.

Justin



On Sat, Jan 5, 2013 at 10:21 AM, Thijs Schreijer <thijs@thijsschreijer.nl> wrote:
I'm working on a UPnP library for home automation. It publishes UPnP services based on drivers that interact with hardware. The services are based on a common api so anyone can add a driver for this own hardware. Consider it a generic gateway.Currently it uses coroutines through copas. And besides the pupnp library everything is Lua code.

Problem: in a system with multiple drivers, one bad driver can hang the whole engine

So I'm considering multithreading,  where each driver get it's own Lua state.

The intend is to run the software on embedded hardware. Typical routers or nas devices. 

Lanes might be a good candidate for the job but I don't know its resource usage.

Any ideas, hints or tips?

Thx. 
Thijs