[In the future please post NSPR questions to
[EMAIL PROTECTED]

liupeng wrote on 9/21/2004, 3:02 AM:
> Hi, 
>     I have one question about NSPR thread using. 
>     From NSPR Refrence,I know when use PR_CreateThread with Localthreads 
> param,the thread will scheduled within a process only and are handled 
> entirely by NSPR.But from reference,I know that NSPR thread is more cheaper 
> than system thread,what does "cheaper" means?Does it means  require less 
> thread than use system therad?

Right now I recommend using PR_GLOBAL_THREADS in most
cases.  You don't need to worry about the difference
between PR_LOCAL_THREADS and PR_GLOBAL_THREADS.  On
most platforms they are the same in the current version
of NSPR.

>     I use NSPR thread to build my server and not use connection pool.When a 
> client request arrive,it will call PR_CreateThread to create a new thread to 
> finish the work,after work,the working thread exit.And I use webload6 to 
> test this server,when use on Linux,the thread will return to orin value when 
> webload load session stoped(use ps command to view).But in SunOS,when 
> webload load session stoped,the thread number can't drop for a long 
> time(also use ps command).And when I test in SunOS,the total thread number 
> will continuous go up when load session start.Can someone explain this 
> differnce?

If you create the threads as PR_JOINABLE_THREAD, you
need to join with them using a PR_JoinThread call.
This is the only potential problem I can think of.

Another possibility is that the Solaris thread library
intentionally keeps the terminated threads around for
a short time so that if you need a new thread, the
thread library can give you one right away.  If
the tool shows that those threads eventually disappear
and the timeout for them is a constant, then this
is likely the case.

Wan-Teh
_______________________________________________
mozilla-crypto mailing list
[EMAIL PROTECTED]
http://mail.mozilla.org/listinfo/mozilla-crypto

Reply via email to