Re: [Jsonrpc-cpp-devel] Multithreaded server
Brought to you by:
s-vincent
From: Sebastien V. <seb...@cp...> - 2012-02-15 15:05:15
|
Hi, Le 15/02/2012 12:38, Ditwin - Contact a écrit : > > > Just for information, d you have reports and statistics about that ? > > > > I have two implementations of my website. The first uses Symfony, the > second is implemented in PHP, and uses a webservice written with JSON > RPC CPP. > > I used Apache Benchmark (ab) to compare the two versions. The second > version is really faster with about 100 calls. But with a more > OK. > > 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 ? > > > Yes. But it could be possible to create a set of initial thread when > the server starts ? This could be more effective this way, rather than > creating one thread, process the method, destroy the thread ... Create > a new new and so on. > > The right way would be to have a thread pool and a set of method to increase/decrease number of threads. > > The mutex is sometime necessary... it depends if you have objects > you would like to share between threads. > > > Ok, I don't need to share objects between thread, because each method > create his own objects depending on the requests. OK. Regards, -- Seb |