# Problem: ruby-fcgi on windows blocks other threads

**URL:** <https://www.ruby-forum.com/t/problem-ruby-fcgi-on-windows-blocks-other-threads/120296>\
**Category:** Ruby\
**Created:** [November 15, 2007, 4:32pm UTC](https://www.ruby-forum.com/t/problem-ruby-fcgi-on-windows-blocks-other-threads/120296 "2007-11-15T16:32:36Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![xuan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/x/a87d85/32.png) [@xuan](https://www.ruby-forum.com/u/xuan)\
**Post date:** [November 15, 2007, 4:32pm UTC](https://www.ruby-forum.com/t/problem-ruby-fcgi-on-windows-blocks-other-threads/120296/1 "2007-11-15T16:32:36Z")

</div>

Hi,

I’m working on a project that requires me to run a multi-thread script  
on windows/apache/fastcgi, but ruby-fcgi seems to block all other  
threads when listening to the request. I tested this on Linux, and fcgi  
works nicely with other threads on Linux; however, I have to do this on  
windows for the project. Can someone tell me why this happens on  
windows?

Thanks

---

<div class="post-metadata">

**Author:** ![xuan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/x/a87d85/32.png) [@xuan](https://www.ruby-forum.com/u/xuan)\
**Post date:** [November 15, 2007, 9:38pm UTC](https://www.ruby-forum.com/t/problem-ruby-fcgi-on-windows-blocks-other-threads/120296/2 "2007-11-15T21:38:16Z")

</div>

On Nov 15, 2007, at 8:32 AM, Zefei X. wrote:

> I’m working on a project that requires me to run a multi-thread script  
> on windows/apache/fastcgi, but ruby-fcgi seems to block all other  
> threads when listening to the request. I tested this on Linux, and  
> fcgi  
> works nicely with other threads on Linux; however, I have to do  
> this on  
> windows for the project. Can someone tell me why this happens on  
> windows?

certion io operations block all threads on windows because ruby uses  
green threads. you must move to a multi-process model - there isn’t  
really another option. if you can spawn the script externally check  
out systemu

[http://codeforpeople.com/lib/ruby/systemu/systemu-1.1.0/README](http://codeforpeople.com/lib/ruby/systemu/systemu-1.1.0/README)

it will at least allow you to spawn background processes in a thread  
without blocking.

regards.

a @ [http://codeforpeople.com/](http://codeforpeople.com/)

---

<div class="post-metadata">

**Author:** ![xuan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/x/a87d85/32.png) [@xuan](https://www.ruby-forum.com/u/xuan)\
**Post date:** [November 16, 2007, 2:30am UTC](https://www.ruby-forum.com/t/problem-ruby-fcgi-on-windows-blocks-other-threads/120296/3 "2007-11-16T02:30:53Z")

</div>

ara.t.howard wrote:

> certion io operations block all threads on windows because ruby uses  
> green threads. you must move to a multi-process model - there isn’t  
> really another option.

Thank you. Does that mean Ruby 1.9 will solve this since it uses kernel  
threads? (I’ve tried to compile 1.9 snapshot and fcgi on windows, but  
they don’t seem to work with apache/fastcgi.)

---

<div class="post-metadata">

**Author:** ![xuan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/x/a87d85/32.png) [@xuan](https://www.ruby-forum.com/u/xuan)\
**Post date:** [November 17, 2007, 12:28am UTC](https://www.ruby-forum.com/t/problem-ruby-fcgi-on-windows-blocks-other-threads/120296/4 "2007-11-17T00:28:02Z")

</div>

On Nov 15, 6:30 pm, Zefei X. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> ara.t.howard wrote:
> 
> > certion io operations block all threads on windows because ruby uses  
> > green threads. you must move to a multi-process model - there isn’t  
> > really another option.
> 
> ## Thank you. Does that mean Ruby 1.9 will solve this since it uses kernel threads? (I’ve tried to compile 1.9 snapshot and fcgi on windows, but they don’t seem to work with apache/fastcgi.)
> 
> Posted viahttp://www.ruby-forum.com/.

i dunno - i’ve barely looked at one nine. sorry.
