Nginx is killing my threads

I have an application in C++ we originally made for Windows using
Microsoft’s http lib, that I have ported to be cross-platform using
To keep it working mostly the same (rewriting as little as possible), I
it as a lib that gets loaded by a module I made for nginx that
with it via a C interface with simple functions (startup, shutdown,
callEndpoint). It works for any calls that don’t depend on threads, but
anything that depends on the worker threads that we create (not using
nginx’s apis) doesn’t work. When I attach to either of the nginx
with gdb and do info threads, I only see one thread each.

I set our function that loads the lib, then calls startup(), which
these worker threads, as the “init module” function. The handle for the
remains so many of the calls work just fine. But the threads are gone,
anything that depends on these worker threads doesn’t function (it
actually). Is there a way to let my module start threads without having
use nginx’s api or otherwise drastically change my architecture?

Posted at Nginx Forum: