Re: [Jsonrpc-cpp-devel] Multithreaded server
Brought to you by:
s-vincent
From: Sebastien V. <seb...@cp...> - 2012-02-15 07:55:14
|
Hi, Le 15/02/2012 01:26, PEI Normandie a écrit : > > My program uses only one thread for treatments. I think Recv should > create his own thread. > > The "select" function allows some concurrent connections. But when the > connections are about hundreds the server is dead, takes all memory > and sleeps ... > Just for information, d you have reports and statistics about that ? > So, make the Recv function to create his own thread, run it and closes > the socket. Do you mean, create one thread per new request ? > > Why should we use a Mutex ? I hope the server's methods can be used > concurrently. If it can't, does that mean that multithreaded server is > useless ? > The mutex is sometime necessary... it depends if you have objects you would like to share between threads. Regards, -- Seb |