Re: [Cppcms-users] 100% cpu usage
Brought to you by:
artyom-beilis
|
From: Petr J. <ele...@ex...> - 2013-07-31 21:55:40
|
I had a quick look over your code, and I also don't understand why you are using async, when all your methods operating synchronously, and block. If you are blocking in an async app, you're blocking the thread pool. Any heavy operation must be processed in the thread-pool using thread_pool::post() method. Petr On 1/08/2013 5:16 AM, Marcel Hellwig wrote: > On 31.07.2013 20:56, Artyom Beilis wrote: >> 1. how do you trigger the loop? > which loop? the thread_pool loop? I don't know ;) >> 2. I don't understand why are you using asynchronous application for >> the WebAPI. You don't do anything asynchronous. > * the json_rpc_chat is also async > * you wrote that an async handler is able to handle more requests at > one than sync one can and it will be designed that the webapi will > provide the whole logic for the game, so you can also do rpc request > from desktop applications. > * async is cool >> More than that calling blocking SQL from event loop is BAD idea. > Hmmm, how to fix it? >> >> also is there any way to make it with less dependencies so I can build it > Hmmm, there aren't many dependencies :/ just cppcms/cppdb/cryptopp and a > self made logger framework logre. > logre can also be found at the git page i provided. > > I also have a logre-less version for you. > http://cookiesoft.de/sp.tar.bz2 > > > > > > > ------------------------------------------------------------------------------ > Get your SQL database under version control now! > Version control is standard for application code, but databases havent > caught up. So what steps can you take to put your SQL databases under > version control? Why should you start doing it? Read more to find out. > http://pubads.g.doubleclick.net/gampad/clk?id=49501711&iu=/4140/ostg.clktrk > > > > _______________________________________________ > Cppcms-users mailing list > Cpp...@li... > https://lists.sourceforge.net/lists/listinfo/cppcms-users > -- Please use PGP to encrypt your email to ensure our privacy is respected. |