# Nginx is killing my threads

**URL:** <https://www.ruby-forum.com/t/nginx-is-killing-my-threads/242363>\
**Category:** NGINX\
**Created:** [June 18, 2015, 7:26pm UTC](https://www.ruby-forum.com/t/nginx-is-killing-my-threads/242363 "2015-06-18T19:26:27Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Detlef\_R](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/58f4c7/32.png) [@Detlef\_R](https://www.ruby-forum.com/u/Detlef_R)\
**Post date:** [June 18, 2015, 7:26pm UTC](https://www.ruby-forum.com/t/nginx-is-killing-my-threads/242363/1 "2015-06-18T19:26:27Z")

</div>

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  
nginx.  
To keep it working mostly the same (rewriting as little as possible), I  
made  
it as a lib that gets loaded by a module I made for nginx that  
communicates  
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  
processes  
with gdb and do `info threads`, I only see one thread each.

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

Posted at Nginx Forum:

> **[Nginx is killing my threads](https://forum.nginx.org/read.php?2,259737,259737#msg-259737)**
>
> 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 nginx. To keep it working mostly the same (rewriting as little as possible), I made it as a lib that gets loaded by...
