[Cppcms-users] Synchronous app calls io_service.post() and blocks itself
Brought to you by:
artyom-beilis
|
From: CN <cn...@fa...> - 2014-03-18 06:57:19
|
My understanding is that all requests sent to booster::aio::io_service are processed "sequentially", meaning that these requests must wait in line for service from the single instance of booster::aio::io_service. This characteristic of "processing requests one at a time" refrains requests from racing issue. Locking is not required in such use case when aio is used instead. This is why my synchronous application calls io_service.post() in order to ensure no racing: async_app->service().get_io_service().post(boost::bind(&my_class::my_method,this)); Now I want this synchronous application not to respond to clients and return immediately. Instead, this synchronous application will wait until my_class::my_method completes before it continues. Is such design correct? If it is, how do I implement this? If it is not, what alternatives do I have? Regards, CN -- http://www.fastmail.fm - Or how I learned to stop worrying and love email again |