Welcome! Log In Create A New Profile

Advanced

why not support multithread?

bit bull
October 11, 2009 10:40AM
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
Subject Author Posted

why not support multithread?

bit bull October 11, 2009 10:40AM

Re: why not support multithread?

Igor Sysoev October 11, 2009 10:46AM

Re: why not support multithread?

bit bull October 11, 2009 11:02AM

Re: why not support multithread?

Igor Sysoev October 11, 2009 11:12AM

Re: why not support multithread?

bit bull October 11, 2009 10:38PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 95
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready