lua-users home
lua-l archive

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



Lanes has a cancellation method for running lanes (= OS threads = independent Lua states).

It does not have per-thread CPU consumption detection, though.

-asko


ketmar kirjoitti 17.7.2008 kello 0:53:

On Wed, 16 Jul 2008 14:42:12 -0700
Chip Salzenberg <chip@pobox.com> wrote:

If a way could be found to atomically install new debug hook settings
from another thread, then sure, that'd be a fine solution to the
"STOP NOW!" problem.
you can set 'count hook' after creating Lua state and then
atomically check 'stop now' flag in this hook. it wouldn't be 'immediate
stop' (without sacrificing performance), but it can work fine (and it
works for me). the big plus (i think) that i can see where script was
interrupted (with help of debug traceback). just fine-tune counter
(once per 100 VM commands, once per 1000, etc). i think this can solve
most of the problems.