[PATCH] Don't accept more connections than workers

2002-04-26 Thread Bill Stoddard
This is a patch to worker.c to prevent more connections from being accepted than there are workers to handle them. The accept thread decrements the avail count and the workers increment the avail count. I don't have a linux box handy so i cannot confirm this patch compiles. Sorry. Bill ==

Re: [PATCH] Don't accept more connections than workers

2002-04-26 Thread Cliff Woolley
On Fri, 26 Apr 2002, Bill Stoddard wrote: > + * later > + */ > +if (!worker_thread_cnt) { > +yield(); > +continue; > +} > + It compiles, but it doesn't link. No such thing as yield(): server/mpm/worker/.libs/libworker.al(worker.lo): In fu

Re: [PATCH] Don't accept more connections than workers

2002-04-26 Thread Cliff Woolley
On Fri, 26 Apr 2002, Bill Stoddard wrote: > This is a patch to worker.c to prevent more connections from being > accepted than there are workers to handle them. The accept thread > decrements the avail count and the workers increment the avail count. I > don't have a linux box handy so i cannot

Re: [PATCH] Don't accept more connections than workers

2002-04-26 Thread Justin Erenkrantz
On Fri, Apr 26, 2002 at 02:07:29PM -0400, Bill Stoddard wrote: > This is a patch to worker.c to prevent more connections from being accepted than >there are > workers to handle them. The accept thread decrements the avail count and the workers > increment the avail count. How about using APR co

Re: [PATCH] Don't accept more connections than workers

2002-04-26 Thread Justin Erenkrantz
On Fri, Apr 26, 2002 at 02:16:51PM -0400, Cliff Woolley wrote: > On Fri, 26 Apr 2002, Bill Stoddard wrote: > > > This is a patch to worker.c to prevent more connections from being > > accepted than there are workers to handle them. The accept thread > > decrements the avail count and the workers

Re: [PATCH] Don't accept more connections than workers

2002-04-26 Thread Cliff Woolley
On Fri, 26 Apr 2002, Justin Erenkrantz wrote: > > Besides, isn't there a race condition here? Or are you assuming ++ and -- > > are atomic? > > IIRC, there's no guarantee for that. -- justin Right. That's why I'm confused. :) --

Re: [PATCH] Don't accept more connections than workers

2002-04-26 Thread Aaron Bannert
On Fri, Apr 26, 2002 at 11:18:58AM -0700, Justin Erenkrantz wrote: > How about using APR condition variables instead of yield()? That was > how I was imagining implementing this. The listener would block > until the queue is not full and then drop into the accept mutex > rotation. I seem to rem

Re: [PATCH] Don't accept more connections than workers

2002-04-26 Thread Cliff Woolley
On Fri, 26 Apr 2002, Aaron Bannert wrote: > LIFO->FIFO change this morning and added a counter to keep track of the > number of elements in the queue. That can be used in a new function > that blocks until the queue is non-full. You mean non-empty, I presume. --Cliff

Re: [PATCH] Don't accept more connections than workers

2002-04-26 Thread Aaron Bannert
On Fri, Apr 26, 2002 at 02:53:59PM -0400, Cliff Woolley wrote: > On Fri, 26 Apr 2002, Aaron Bannert wrote: > > > LIFO->FIFO change this morning and added a counter to keep track of the > > number of elements in the queue. That can be used in a new function > > that blocks until the queue is non-f

Re: [PATCH] Don't accept more connections than workers

2002-04-26 Thread Bill Stoddard
> On Fri, 26 Apr 2002, Bill Stoddard wrote: > > > This is a patch to worker.c to prevent more connections from being > > accepted than there are workers to handle them. The accept thread > > decrements the avail count and the workers increment the avail count. I > > don't have a linux box handy

Re: [PATCH] Don't accept more connections than workers

2002-04-26 Thread Brian Pane
Bill Stoddard wrote: >>On Fri, 26 Apr 2002, Bill Stoddard wrote: >> >>>This is a patch to worker.c to prevent more connections from being >>>accepted than there are workers to handle them. The accept thread >>>decrements the avail count and the workers increment the avail count. I >>>don't have