Why not support multithread?

hi, all:

 I saw multithread is supported at Nginx SourceCode. But complie

configure hiden this feature.

 I modified some source to open it, then run Nginx. DeathLock(lock

and lock again) happened, Nginx is Hanging.

I modified two files to solution this problem:

— nginx-0.8.19/src/event/ngx_event_timer.c 2009-10-11
19:49:04.000000000 +0800
+++ src/event/ngx_event_timer.c 2009-10-11 18:19:44.000000000 +0800
@@ -82,11 +82,13 @@

 for ( ;; ) {

     ngx_mutex_lock(ngx_event_timer_mutex);

     root = ngx_event_timer_rbtree.root;

     if (root == sentinel) {
  •        ngx_mutex_unlock(ngx_event_timer_mutex);
           return;
    

— nginx-0.8.19/src/event/modules/ngx_epoll_module.c 2009-10-11
19:49:04.000000000 +0800
+++ src/event/modules/ngx_epoll_module.c 2009-10-11 19:43:56.000000000
+0800

@@ -639,7 +639,10 @@
ngx_locked_post_event(rev, queue);

         } else {
  • ngx_mutex_unlock(ngx_posted_events_mutex);
    rev->handler(rev);
  • ngx_mutex_lock(ngx_posted_events_mutex);
    }
    }

@@ -658,12 +661,15 @@
ngx_locked_post_event(wev, &ngx_posted_events);

         } else {
  • ngx_mutex_unlock(ngx_posted_events_mutex);
    wev->handler(wev);
  • ngx_mutex_lock(ngx_posted_events_mutex);
    }
    }
    }

    Now it run, and seem no problem (I feeling have some problems 

yet).
I what to know why not support multithread in public, have
other problem in current version?

thanks~
bb

On Sun, Oct 11, 2009 at 10:33:38PM +0800, bit bull wrote:


     if (root == sentinel) {
         } else {
         } else {
    Now it run, and seem no problem (I feeling have some problems yet).
    I what to know why not support multithread in public, have

other problem in current version?

The threads support in nginx is currently broken and this patch does not
fix it.

thanks Igor, I know this patch doesn’t fix it, it’s my test code.

Can you introduce more details about multithread’s “broken” (what
problems is current version) ?

2009/10/11 Igor S. [email protected]:

On Sun, Oct 11, 2009 at 10:58:48PM +0800, bit bull wrote:

thanks Igor, I know this patch doesn’t fix it, it’s my test code.

Can you introduce more details about multithread’s “broken” (what
problems is current version) ?

No, there are too many places required multithreaded handling.

thanks for your help.

2009/10/11 Igor S. [email protected]: