Re: [Cppcms-users] 100% cpu usage
Brought to you by:
artyom-beilis
|
From: Artyom B. <art...@ya...> - 2013-08-02 07:31:01
|
> >Artyom, > >Is cppcms::http::response and cppcms::http::context thread safe? >I'm trying to decide, in the design of my app, whether I should be writing >to response().out() from the thread pool or whether I should be queuing >messages and sending them out from a single thread. > >Cheers, >Petr > No, THEY ARE NOT. http://cppcms.com/wikipp/en/page/thread_safety In async app you need to use response from the event loop and in synch app from the thread executing the request. If you want to do something in thread pool post a job to the thread pool, from the pool post a job to event loop with the results and **than** use the response(). Artyom Beilis -------------- CppCMS - C++ Web Framework: http://cppcms.com/ CppDB - C++ SQL Connectivity: http://cppcms.com/sql/cppdb/ |