You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Eli Marmor <ma...@elmar.co.il> on 2000/02/13 21:23:53 UTC

undefined MULTITHREAD under NT

Hello,

Is there any way to avoid MULTITHREAD under NT?  Maybe by using Bill
Stoddard's patch for sharing sockets under NT?  (see also
http://www.apache.org/~stoddard/nt_socket_share.patch , and
http://www.progressive-comp.com/Lists/?l=apache-new-httpd&m=92956640311036&w=2
).

Since the only usable version so far is 1.3.*, the question is about
it. The purpose is a quick and dirty solution for 3rd party modules
which were written before multi-threading safety was an issue, and
should be ported quickly to NT. Of course, somewhere in the future,
such modules should pass a real porting, including locking and a
better management of the memory, which will be safe of multi-
threading, but meanwhile it can be very useful to have this shortcut
way.

BTW: Did anybody see Vision for Apache?
	( http://www.focus-array.com/ )
Not Open Source, and even costs money if you are commercial, but
looks good...

Thanks in advance,
-- 
Eli Marmor
marmor@elmar.co.il
El-Mar Software Ltd.

Re: undefined MULTITHREAD under NT

Posted by rb...@apache.org.
What I was suggesting was each hook would have it's own mutex variable,
and for each hook you would lock that variable when the function is called
and unlock it just before you leave the function.  This may lead to
deadlock, but for most modules it will work just fine.

Setting ThreadsPerChild to 1 for NT will leave your server able to process
one request at a time.  I seriously doubt that is what you want to do.

Ryan

> Not exactly.
> 
> If (hypothetically) the whole request was implemented in one call to
> one function of the module (which may call other functions
> internally), then you were right. But a request is a long procedure,
> with many functions calls (from the Apache core to the module), and
> many phases.
> 
> Of course, if your meaning was to lock at the beginning of the
> *request* and unlock at its end, then it is possible, but it isn't
> better than just set ThreadsPerChild to 1, which is hundreds of
> percents slower than the default situation, and may lead even to
> (I'm not sure) deadlocks.
> 
> -- 
> Eli Marmor
> 


Come to the first official Apache Software Foundation
Conference!!!   <http://ApacheCon.Com/>

_______________________________________________________________________________
Ryan Bloom                        	rbb@ntrnet.net
2121 Stonehenge Dr. Apt #3
Raleigh, NC 27615		Ryan Bloom -- thinker, adventurer, artist,
				     writer, but mostly, friend.
-------------------------------------------------------------------------------


Re: undefined MULTITHREAD under NT

Posted by Eli Marmor <ma...@elmar.co.il>.
Thank you!

> On Apache 1.3, the only way to run Apache under NT is mult-threaded.  The
> best way to port your module quickly is to put locking around all of the
> modules.

Not exactly.

If (hypothetically) the whole request was implemented in one call to
one function of the module (which may call other functions
internally), then you were right. But a request is a long procedure,
with many functions calls (from the Apache core to the module), and
many phases.

Of course, if your meaning was to lock at the beginning of the
*request* and unlock at its end, then it is possible, but it isn't
better than just set ThreadsPerChild to 1, which is hundreds of
percents slower than the default situation, and may lead even to
(I'm not sure) deadlocks.

-- 
Eli Marmor

Re: undefined MULTITHREAD under NT

Posted by Ryan Bloom <rb...@ntrnet.net>.
On Apache 1.3, the only way to run Apache under NT is mult-threaded.  The
best way to port your module quickly is to put locking around all of the
modules.

The socket passing patch from Bill just allows the parent process to pass
the socket to the child process so that restarts can be done gracefully.
This does nothing for the multi-threaded nature of NT.

Ryan

On Sun, 13 Feb 2000, Eli Marmor wrote:

> Hello,
> 
> Is there any way to avoid MULTITHREAD under NT?  Maybe by using Bill
> Stoddard's patch for sharing sockets under NT?  (see also
> http://www.apache.org/~stoddard/nt_socket_share.patch , and
> http://www.progressive-comp.com/Lists/?l=apache-new-httpd&m=92956640311036&w=2
> ).
> 
> Since the only usable version so far is 1.3.*, the question is about
> it. The purpose is a quick and dirty solution for 3rd party modules
> which were written before multi-threading safety was an issue, and
> should be ported quickly to NT. Of course, somewhere in the future,
> such modules should pass a real porting, including locking and a
> better management of the memory, which will be safe of multi-
> threading, but meanwhile it can be very useful to have this shortcut
> way.
> 
> BTW: Did anybody see Vision for Apache?
> 	( http://www.focus-array.com/ )
> Not Open Source, and even costs money if you are commercial, but
> looks good...
> 
> Thanks in advance,
> -- 
> Eli Marmor
> marmor@elmar.co.il
> El-Mar Software Ltd.
> 


Come to the first official Apache Software Foundation
Conference!!!   <http://ApacheCon.Com/>

_______________________________________________________________________________
Ryan Bloom                        	rbb@ntrnet.net
2121 Stonehenge Dr. Apt #3
Raleigh, NC 27615		Ryan Bloom -- thinker, adventurer, artist,
				     writer, but mostly, friend.
-------------------------------------------------------------------------------