I do not want a "replacement", just the possibility to convert coroutines as plain threads. I do not contest the interest of coroutines, basically for implement the producer/consumer model within the same app, but not for handling services between different users or diffeernt security contexts.
On Mon, Mar 11, 2019 at 5:16 AM Philippe Verdy <verdy_p@wanadoo.fr> wrote:
> If we want true multithreading in Lua, the Lua states (those exposed in the Lua language, not those in LuaC!) should also be runnable concurrently without even having to yield: a thread could be started with a time slot limit (by default infinite like today) that the VM would preempt and it's natural in that case that these Lua states (not LuaC states) are implementede on top of preemptable POSIX-like threads, managed at OS level.
Are you aware that coroutines solve some problems, and that threads
are a very poor substitute for coroutines? Why do you want to
sacrifice them to get threads? You can (easily) simulate coroutines
using threads or processes ( or machines ), but they are not a good
substitute.
Also, are you aware that enabling thread support on a language makes
every piece of code pay a price, even the non-threaded ones?
Francisco Olarte.