|
Boost : |
From: christopher baus (christopher_at_[hidden])
Date: 2005-12-16 14:26:44
"Christopher Kohlhoff" <chris_at_[hidden]> wrote:
> Yep, sorry I haven't replied to your related email on event
> throttling... still trying to catch up on digesting all the emails!
No problem. I was beginning to wonder if you are sleeping :)
> I think this hard limit could be made configurable by adding a new
> class/service pair. E.g.:
>
> template <typename Allocator = std::allocator<void> >
> class limits_service
> {
> ...
> };
>
> template <typename Service>
> class basic_limits
> {
> public:
> basic_limits(demuxer_type& d);
> void post_queue(std::size_t value);
> std::size_t post_queue() const;
> ... and so on ...
> };
>
> typedef basic_limits<limits_service<> > limits;
>
> Usage:
>
> boost::asio::demuxer d;
> boost::asio::limits l(d);
> l.post_queue(42);
>
That looks good to me.
> Any suggestions about what sort of numbers should be used by default?
42 sounds good. :)
My gut instinct would be to make it a multiple of the number of
connections you intend to handle. Like num_connections * 5. The chance
that there is 5 operations pending/connection is pretty unlikely. Usually
there is at most 2. The I/O event and the timeout.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk