Boost logo

Boost Users :

Subject: Re: [Boost-users] UDP Echo Server
From: Vinnie Falco (vinnie.falco_at_[hidden])
Date: 2017-08-25 01:34:32


On Thu, Aug 24, 2017 at 6:07 PM, Mark Hieber via Boost-users
<boost-users_at_[hidden]> wrote:
> My questions are:
> 1) Should I re-write this to run on one core? We see performance issues on
> one core.
> 2) Is this a good candidate for boost::fibers? If so, what approach should I
> take? Still use boost::asio and async reads and writes?

If all you are doing is echoing UDP packets, then your program is
certainly not CPU or disk-bound. It will be constrained to the
performance of the network subsystem. I highly doubt that you need
more than one thread for that.

You said that you see performance issues on one core, are you sure
about that? I would double check and make doubly sure that your
measurements are accurate.

For UDP I don't see much difference between 1 port or 10, since UDP
packets are stateless. The number of ports should not matter.

You ask if you should re-write it to run on one core. That should be
easy to do without "rewriting" your entire program, just use a single
io_service and only call io_service::run from one thread. Fibers won't
be particularly helpful since you are not CPU or disk bound.

Are you running an optimized or a debug build?

Thanks


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