lua-users home
lua-l archive

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


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.