lua-users home
lua-l archive

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

On 29 September 2017 at 15:05, Илья Удалов <> wrote:
> Yes. Effil sets debug hook. Per 200 instructions by default.
> Yes. runner.step = 0 completely disable this hook.
> This hook insufficiently effects on performance. About 0.5 % with default value.

Well, since you replied on-list, I'll move the conversation on-list. :)

Wouldn't it be possible to leave the hook disabled by default and only enable it
when a thread calls thr:pause()? lua_sethook is async-safe so you'd only need
a lock to make sure that the state is not lua_close'd in the meantime (and not
to lock the actual execution of the thread).

(The lua.c interpreter does a roughly similar thing to forward a
cancellation request via the signal handler.)

Just throwing an idea out there!

-- Hisham

> You also can add cancelation point effil.yield()
> --
> Ilia
>> On 29 Sep 2017, at 20:53, Hisham <> wrote:
>> Hi,
>> A tiny off-list question, sorry for being lazy and not checking in the code:
>> the docs mention the runner.step function, which is specified in terms
>> of number of Lua instructions. Does that mean that every thread runs
>> with a debug hook plugged in by default? If so, did you notice any
>> performance impact in that? Does setting it to 0 fully disable the
>> hook?
>> Thank you for this library! I have used Lanes in the past but I got an
>> even better vibe from Effil's docs!
>> -- Hisham
>>> On 29 September 2017 at 10:13, Илья Удалов <> wrote:
>>> 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
>>> Blog post about Effil:
>>> —
>>> Ilia and Miha