From: Rob McCool
Newsgroups: netscape.devs-nsapi
Subject: Re: Enterprise thread usage on NT?
Date: Wed, 18 Dec 1996 17:58:42 -0800
> Is there any way to control the number of listener threads that are
> spawned by the server, the way you could with the Commerce server?
>
> I have a service function that caches some data with
> systhread_setdata, and my tracing indicates that every web access is
> apparently to a new thread. The getdata call is never returning any
> cached data, so my assumption is that I'm simply never reusing a
> thread, rather than that TLS is broken.
>
> The process itself had spawned like 96 threads, which I hope were not
> all listener threads! I also hope threads aren't all spawned
> dynamically. If they are, what's the point of using the TLS facility?
The last time I looked the NT servers were spawning 40 threads and that
value was not configurable. I don't recall what the reasoning was for
not making the value configurable, the NT thread dispatching code was
not my area.
I believe threads are used in order, i.e. each time a request comes in a
thread is awakened from sleeping on a lock. The order that threads are
awakened is operating system dependent, and I think that for the locks
we're using NT uses FIFO ordering.
I'm not sure what you're using TLS for, if you're using it to store some
sort of inter-request state then I would recommend against it. You are
not guaranteed that the thread which serviced the first request will be
the same as the thread which services the second. This does limit the
usefulness of TLS in the NSAPI, but we provide it because it is useful
in certain cases.
--
Rob McCool, robm@netscape.com http://home.netscape.com/people/robm/
--
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.