lua-users home
lua-l archive

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


Hello Steve,

> Then why not run them as coroutines ("daughter threads")?  They then
> share global data automatically.

I don't think that this is an option for me because I need the results
of every interpreter call directly in the outside C++ code.

And: There isn't a clear 1:1 alternation between the both calls. There
are situations without any outgoing data or in other words only one data
direction (I stated it as incoming and outgoing data, but a better
description would be just the data of two directions. I.e. in a field
bus system there are telegrams from a master and telegrams from a slave.
Independent of the wiring or kind of bus attachment the software sees
the telegrams in one or two different directions).

In this case the second coroutine wouldn't have to do anything. 
In my design the interpreter is only called 'when' data of the right
direction is available. So I don't have to worry about 'no data at all'.

But I'm not very familiar with the coroutine principle. Maybe I should
give it a try.

Thank you

Joachim