On 26 December 2014 at 21:04, Yichun Zhang (agentzh) <age...@gmail.com> wrote:
> On Fri, Dec 26, 2014 at 5:32 PM, Daurnimator wrote:
>> The next problem I faced is actually a seperate one, and I should
>> probably fork the thread:
>>
>
> Yes, please.
>
>> Mixing coroutine functions results in strange errors: many functions
>> seem to not check their input well/correctly.
>>
>
> Well, feel free to create pull requests for ngx_lua :)
The changes I would make are perhaps a bit more structural than may be
accepted in a pull request.
Also I expect you do extensive bench-marking and other analysis on the codebase;
To ensure performance doesn't plummet, how do I run some
benchmarks/tests locally?
>> e.g, this causes a SIGABRT at
>> https://github.com/openresty/lua-nginx-module/blob/af16d1f99441b622188e91ef64dad61da024eae1/src/ngx_http_lua_util.c#L1052
>>
>> local co = coroutine.create(function()
>> coroutine._yield(10)
>
> Do you know that the coroutine._yield() thing is an intentionally
> undocumented internal API that is never supposed to be called by the
> users?
Yes, it is the original coroutine.yield.
I used it to demonstrate what some C function using lua_yield() does.
Perhaps you could do some trickery with the dynamic linker to get loaded
libraries to use `ngx_http_lua_coroutine_yield` and friends instead?