These are chat archives for ChaiScript/ChaiScript

Oct 2015
Oct 21 2015 15:08
@lefticus Do you have any plans about coroutines/green threads support in ChaiScript? With this "are_we_done_yet" callback from my previous question (IActiveScriptSiteInterruptPoll) I could (kinda) do it myself - just by yield-ing from this callback with (for example) Boost.Coroutine. But this will require an instance of script engine per coroutine (different script contexts). Would be cool to have "spawn(my_function)" script command (my_function runs in same script context) and list of those green threads at C++ side to be able to run them one step at a time (this way host could implement any sheduling needed, for example running scripts for 0.5 sec every second and then spenging another 0.5 sec doing other stuff).