lua-users home
lua-l archive

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


Hi all,

 

I’ve been using lua for some time as an embedded scripting language. The implementation was a pre-emptive multitasking environment. I now have the intention to do some lua-only developments and have been looking into the cooperative multitasking model.

 

The basics are very clear, but there is one part that I feel uncomfortable with; How often and when would I have to yield? Are there any guidelines on that?

 

In general my understanding is that not yielding for too long, will make other threads unresponsive, that’s obvious. But I intent do use luasockets and maybe some RS232 serial stuff, so that’s where my concerns are; loosing incoming data on those IO channels because another thread doesn’t yield in time.

 

The google mainly returned long debates on preemptive vs cooperative, but no info on how to make it work best.

 

So; where do I need to look for this info? And hints/tips? Thx for your help!

 

Regards,

Thijs