3 ms·
Tcl is another well-established language which has had full coroutine support for 10 years now. As with Lua, a Tcl coroutine has to explicitly yield for execut
by cmacleod4 4y ago
Tcl is another well-established language which has had full coroutine support for 10 years now. As with Lua, a Tcl coroutine has to explicitly yield for execution to switch to another coroutine. I would not see preemptive scheduling of coroutines as an advantage, it opens up all the unsafe concurrency issues you get with threads, but without getting threads' advantage of running on multiple cores to compensate. Coroutines in Tcl also integrate cleanly with the existing event system, this allows writing event-driven code without the awkwardness of control inversion, also known as callback hell.