lua-users home
lua-l archive

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


Hi Joshua!

Basically Effil brings inter threads shares tables.
You to use nested  tables over threads (even recursively):
local effil = require "effil"

local t = effil.table {1, "I am string"}
local res = effil.thread(
function(t)
    t.self = t
end)(t):get()

print(t.self.self.self.self[2])

Also with metatables:
local greeting = effil.table()
effil.setmetatable(greeting, { __call = function(t, name)
    print("Hi " .. name)
end })

effil.thread(function (greeting)
    greeting("Lua mailing list")
end)(greeting):wait()

Effil have linda like objects with almost same API - channels. It also provides operations with timeouts.
Effil can cancel thread like lanes. But currently it does not have API for change thread priority https://github.com/effil/effil/issues/77
Effil doesn't have locks and times as separate API. Locks seems to be dangerous in multithreading-cancelable environment. Very easy make deadlock. But if you really need them - you can implement locks and timers over effil.channel. 

Ilia
29 сент. 2017 г., в 16:13, Илья Удалов <udalovilia@gmail.com> написал(а):

Hi,

Take a look at new gorgeous lua module for multithreading - Effil.
Main feature are:
- thread safe tables.
- threads can be paused/resumed and canceled.
- FIFO channels.

Install it from  luarocks: luarocks install effil
Sources hosted on GitHub https://github.com/effil/effil

Ilia and Miha