Thread: [Cppcms-users] Heavy background processing
Brought to you by:
artyom-beilis
|
From: Petr J. <ele...@ex...> - 2013-05-03 03:22:14
Attachments:
signature.asc
|
Hi, I need to run a background process that does some heavy work, and needs to run asynchronously (from the moment main() is executed until it's stopped). So i've been reading about asynchronous applications(the chat example) but I read a thread on this mailing list suggesting that heavy processing applications shouldn't be run in the main event loop asynchronously. I'm also going to need to long-poll the background app because it will print details to a page about it's status. How should such background processing be run? Thanks, Petr -- Please use PGP to encrypt your email to ensure our privacy is respected. |
|
From: Petr J. <ele...@ex...> - 2013-05-03 03:28:11
Attachments:
signature.asc
|
Reading the "thread safety" page, it suggests "If asynchronous application or any other object that runs in the event wants to execute some long running, blocking or heavy operation, it may do it by submitting an execution handler to the thread pool." How is such handler created and submitted to the thread pool? On 3/05/2013 1:22 PM, Petr Janda wrote: > Hi, > > I need to run a background process that does some heavy work, and needs > to run asynchronously (from the moment main() is executed until it's > stopped). > > So i've been reading about asynchronous applications(the chat example) > but I read a thread on this mailing list suggesting that heavy > processing applications shouldn't be run in the main event loop > asynchronously. > > I'm also going to need to long-poll the background app because it will > print details to a page about it's status. > > How should such background processing be run? > > Thanks, > Petr > > > > ------------------------------------------------------------------------------ > Get 100% visibility into Java/.NET code with AppDynamics Lite > It's a free troubleshooting tool designed for production > Get down to code-level detail for bottlenecks, with <2% overhead. > Download for free and get started troubleshooting in minutes. > http://p.sf.net/sfu/appdyn_d2d_ap2 > > > > _______________________________________________ > 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. |
|
From: Artyom B. <art...@ya...> - 2013-05-03 07:55:10
|
>________________________________ > From: Petr Janda <ele...@ex...> >To: cpp...@li... >Sent: Friday, May 3, 2013 6:28 AM >Subject: Re: [Cppcms-users] Heavy background processing > > >Reading the "thread safety" page, it suggests > >"If asynchronous application or any other object that runs in the event >wants to execute some long running, blocking or heavy operation, it may >do it by submitting an execution handler to the thread pool." > >How is such handler created and submitted to the thread pool? http://cppcms.com/cppcms_ref/1.0.0/classcppcms_1_1service.html#a9f52695695783504530983d5d76f44e7 http://cppcms.com/cppcms_ref/latest/classcppcms_1_1thread__pool.html Artyom Beilis -------------- CppCMS - C++ Web Framework: http://cppcms.com/ CppDB - C++ SQL Connectivity: http://cppcms.com/sql/cppdb/ |
|
From: Petr J. <ele...@ex...> - 2013-05-03 08:18:22
Attachments:
signature.asc
|
Yeah I've seen that. Here is what I'd need to do: Async app sends a handler to threadpool to execute a heavy processing task via threadpool::post. Ok Suppose the heavy processing task wants to print out a status ie. "Task 1 processed, Task 2 processed etc" and want to send it back the the Async app that move the processing to the thread pool so that they can be displayed on a webpage via a long-polling request. Is service::post() used for this? If there was multiple async apps, how to designate the one that should receive these messages? What am I missing? On 3/05/2013 5:55 PM, Artyom Beilis wrote: > > >> ________________________________ >> From: Petr Janda <ele...@ex...> >> To: cpp...@li... >> Sent: Friday, May 3, 2013 6:28 AM >> Subject: Re: [Cppcms-users] Heavy background processing >> >> >> Reading the "thread safety" page, it suggests >> >> "If asynchronous application or any other object that runs in the event >> wants to execute some long running, blocking or heavy operation, it may >> do it by submitting an execution handler to the thread pool." >> >> How is such handler created and submitted to the thread pool? > > http://cppcms.com/cppcms_ref/1.0.0/classcppcms_1_1service.html#a9f52695695783504530983d5d76f44e7 > > http://cppcms.com/cppcms_ref/latest/classcppcms_1_1thread__pool.html > > > > > > > Artyom Beilis > -------------- > CppCMS - C++ Web Framework: http://cppcms.com/ > CppDB - C++ SQL Connectivity: http://cppcms.com/sql/cppdb/ > > ------------------------------------------------------------------------------ > Get 100% visibility into Java/.NET code with AppDynamics Lite > It's a free troubleshooting tool designed for production > Get down to code-level detail for bottlenecks, with <2% overhead. > Download for free and get started troubleshooting in minutes. > http://p.sf.net/sfu/appdyn_d2d_ap2 > _______________________________________________ > 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. |