|
Yes, I agree that the argument is only performance (which was one reason I was trying to avoid a OS timer thread). I am using this hook on lua threads which have their own environment. The overhead of the hook would appear to be in the order of >5% . And yes the table lookups are not so bad in comparison. The Mike Pall hook count scheme works OK. There is the strong possibility that I may have originally asked the wrong question.Restating my problem : I am executing user code in Lua threads and I seek a low overhead means of terminating user tasks that exceed a predefined time limit. thanks David B Roberto wrote:
Please remember that hooks already have the whole Lua state as a "closure". The point here is only performance. Setting a hook already has a big impact on performance. Does it make a significant difference an extra access to the registry inside the hook? -- Roberto