From: Rob McCool 
Newsgroups: netscape.devs-nsapi
Subject: Re: Help forcing NSAPI program to multithread
Date: Tue, 19 Nov 1996 12:26:25 -0800

Under AIX 3.x and 4.1, the Netscape server threading library does not 
allow concurrent system calls. So if your library performs a recv()
or a gethostbyname() and blocks, all of the threads in that process
will block until it is finished. If your library uses net_read() to
perform its I/O, then only the calling thread (not the process) will 
be blocked.

The AIX 4.2 version of the server uses AIX native threads, and allows
concurrent system calls.


Dave Rollins wrote:
> 
> I've successfully built an NSAPI routine that connects to a broker
> process to service requests. The broker then tells the NSAPI program to
> listen on a given port. The broker then passes the request to one of
> many known appservers available to service this request. The appserver
> chosen then conencts to the listening NSAPI process and services the
> request.
> 
> This works great on NT. If I have 10 appservers known to the broker
> process then each server is hit in turn and my dynamic load balancing
> scheme works wonderfully.
> 
> But on AIX 4.1.4 I have a problem. It appears that the NSAPI shared
> library I created is single threaded. Only one request at a time is sent
> to the broker. I never have more than one appserver running. For obvious
> reasons this is not good in terms of scalability. I've created a cgi
> version that works fine and fires across many connections simultaneously
> on this platform but have yet to get the NSAPI version working
> correctly.
> 
> Do I need to configure the netscape server somehow to force it to treat
> each request as a seperate thread or do I need to compile the shared
> object differently than described in
> http://home.netscape.com/newsref/std/server_api.html "Creating A Shared
> Object" for AIX?
> 
> Any help would be appreciated
> 
> --
> 
> Dave Rollins                    Web Dynamics, Inc.
>                                 Avon, Connecticut
> dmr@mail.scsinfo.com            http://www.colatool.com/
> 
> voice: (860) 677-0222 ext 57    fax: (860) 677-7157

--
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.