<div dir="ltr">Hello there,<div><br></div><div>I had earlier asked about how to access LuaJIT from erlang [<a href="http://erlang.org/pipermail/erlang-questions/2016-August/089939.html\">http://erlang.org/pipermail/erlang-questions/2016-August/089939.html</a>] and based on the responses, I decided to go with C port. It was working all great. Except, when I tried to call the same C-Port [luajit] code from erlang-diameter server. Since the requests were high, but not very high (approx 10K per second), the code fails with stack overflow on c side.</div><div><br></div><div>Now I thought, I would create a seperate C port for each requests but that would mean there will be around 10K c-port processes. I'm now wondering how to handle this size of requests from the c port. Any help or direction is appreciated. Please let me know if my question is not clear. I'm attaching the code to access lua that works with single instance of c-port process.</div><div><br></div><div>Regards</div><div>Arshad</div><div><br></div><div>/************ CODE Details *********************/</div><div><br></div><div>erl_com.c contains code to send/receive data from c side</div><div>port.c runs the lua code and has main</div><div>script.lua </div><div>relay.erl starts the relay server and c port to talk to lua</div><div>relay_cb.erl handles requests and communicates with lua</div><div><br></div></div>