Thanks for Julien Pierre. "Julien Pierre" <[EMAIL PROTECTED]> ??????:[EMAIL PROTECTED] > liupeng wrote: > > Hi, > > I have one question about NSPR thread. > > I use NSS-3.9 build my server,and Use NSPR to handling my thread.When a > > client request arrive,I use PR_CreateThread to create a new thread like > > following: > > thr = PR_CreateThread(PR_USER_THREAD, > > SSLService_ThreadFun, > > (void*)arg, > > PR_PRIORITY_NORMAL, > > PR_LOCAL_THREAD, > > PR_UNJOINABLE_THREAD, > > 0); > > In Function SSLService_ThreadFun,I will deal with the client request,and > > the function will exit after the transaction was complete.In SunOS5.8,I use > > webload 6.0 to test my server,when client request arrive,it will create much > > more thread to deal with the request,and these thread will not exit until > > client request stop for a long time(use syscommand ps to check),and > > sometimes the threadnumber will reduce to a value that less than it's start > > value,but this thing will not appear in other platform,why? > > > > > > LiuPeng > > > > > > You are using user threads, which are managed by NSPR. The system > command ps cannot monitor NSPR user threads. You probably want to use > system threads instead. > > However, experience dictates that you do not want to create threads > on-demand when connections arrive in the server. The thread creation > will induce latency. You should instead pre-start your server threads > and have some kind of queue mechanism to to process the requests. Don't > have all your threads in accept as this will be inefficient. If you have > dedicated accept threads, you can get away with having very few accept > threads, eg. 2 to 4 times the number of physical CPUs. >
_______________________________________________ mozilla-crypto mailing list [EMAIL PROTECTED] http://mail.mozilla.org/listinfo/mozilla-crypto
