[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Lua coroutine using
- From: "Петров Александр" <gmdidro@...>
- Date: Mon, 27 Oct 2008 18:52:26 +0300
I work on laboratory equipment control system. In that system we use
Lua as tool for describing control sequences:
--set pin #12 to one state (5v), wait for signal on pin #10, reset pin #12
We need control many pins concurrently, so we use coroutines:
In other words, we use coroutines, because of concurrent waiting.
Up until now we've been working with small numbers of coroutines
(1...5) and all code that we need, we generate in such coroutines.
Now, we have to implement interpreter mode in our system and so
operator could send new commands *after* early created coroutines have
been run. So we have to create new coroutine for every new operator
command (because AFAIK we can't add Lua code to early created
The question - Is it normal to have 500...1000 coroutines in program ?
Don't that cause system resources leak ?