|
Boost Users : |
Subject: Re: [Boost-users] [asio] Synchronous/Asynchronous pattern
From: Rutger ter Borg (rutger_at_[hidden])
Date: 2009-03-10 07:32:48
Igor R wrote:
>> However, I'm not sure whether to choose of poll_one or run_one in this
>> case. I.e., I'm looking for the cheapest "do some other stuff" of asio's
>> io_service.
>
> run_once() is ok here, but anyway your loop will *block* any further
> iterations until result_available == true, won't it? If so, why not
> just use synchronous asio functions? Actually, they are already
> implemented in the very similar way to what you're trying to do.
Thanks. I'm aware of asio's synchronous operation support. However, the
application in question implements a producer/consumer pattern, with
potentially many blocking consumers at the same time in the same
application. Other work should be done while "blocking", to keep as many
threads as possible going. Why is run_one better than poll_one in this
case?
Thanks,
Kind regards,
Rutger
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net