# Thread started by module put to sleep state

**URL:** <https://www.ruby-forum.com/t/thread-started-by-module-put-to-sleep-state/245513>\
**Category:** NGINX\
**Created:** [June 6, 2013, 5:17pm UTC](https://www.ruby-forum.com/t/thread-started-by-module-put-to-sleep-state/245513 "2013-06-06T17:17:47Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sadaf\_N](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/858c86/32.png) [@Sadaf\_N](https://www.ruby-forum.com/u/Sadaf_N)\
**Post date:** [June 6, 2013, 5:17pm UTC](https://www.ruby-forum.com/t/thread-started-by-module-put-to-sleep-state/245513/1 "2013-06-06T17:17:47Z")

</div>

Hi everyone,

I’ve been trying to embed mono within nginx to serve requests with

> **[ASP.NET | Open-source web framework for .NET](https://dotnet.microsoft.com/en-us/apps/aspnet)**
>
> Build web apps and services that run on Windows, Linux, and macOS using C#, HTML, CSS, and JavaScript. Get started for free on Windows, Linux, or macOS.

just for learning purposes (I know there is a FastCGI server for mono  
out  
there), and I’m running into a problem.  
When I call into C# code, mono’s runtime creates a thread to serve the  
request, but this thread is always in sleep state, and for this reason  
the  
response never comes, i.e. the browser appears to try to load the page  
indefinitely.  
I have tried to embed the same C# code into a C application that  
simulates  
the request (no nginx involved) and the request gets processed normally.

I don’t know what kind of information I can show you to help debug the  
problem, but, so far, this is just a simple handler that pretty much  
kills  
nginx’s event loop by waiting for the full response to come. I know that  
if  
I simulate a quick response in the C# side (without really handling it  
appropriately, i.e. just creating some buffers with “Hello world”) the  
response comes out nicely.

What could be the cause of this?

Thank you in advance,  
Marcelo Zabani.

Posted at Nginx Forum:

> **[thread started by module put to sleep state](https://forum.nginx.org/read.php?2,239921,239921#msg-239921)**
>
> Hi everyone, I've been trying to embed mono within nginx to serve requests with ASP.NET just for learning purposes (I know there is a FastCGI server for mono out there), and I'm running into a problem. When I call into C# code, mono's runtime creates...
