From: Rob McCool
Newsgroups: netscape.devs-nsapi
Subject: Re: Questions on threads...
Date: Thu, 19 Dec 1996 13:25:27 -0800
> 2. If I configure my server with 1 process and 10 threads and use a
> cgi program that connects to a backend that accepts connections and
> does nothing with the I can make 10 connections from my browser with
> no problem. On the 11th connection the browser just hangs(which is
> what I expect). Now if configure my server with 1 process and 10
> threads and use the NSAPI to connect to the same backend program I
> only get 1 connection. What am I doing wrong??
You're probably having problems because of the threading implementation
under HPUX. Because HPUX doesn't provide threads natively, we had to
write our own threading implementation. The problem with the threading
implementation is that it does not allow concurrent system calls. So if
your back end code is making a system call and blocks, no other thread
in the process can run until it is finished. The (unfortunate) solution
is to run the server with multiple processes and one thread per process,
or use CGI.
If you can write the back end code so that any network I/O it does go
through the NSAPI net_* calls, then you will not have a problem with
concurrent execution since the net_* calls will not block the entire
process.
--
Rob McCool, robm@netscape.com http://home.netscape.com/people/robm/
Stunt Programmer, Netscape Communications Corporation
It was working ten minutes ago, I swear...
Reproduced by permission of the author.