Boost logo

Boost Users :

Subject: [Boost-users] Asio and software interrupts
From: Joseph Sulewski (joemacher_at_[hidden])
Date: 2012-11-28 16:34:43


Hello,

I’m use the Boost::Asio libraries to read data from multicast sockets.
This is a high rate application that needs to listen to data coming on a
large number of multicast addresses (up to 500 different addresses). I
would like to funnel all the multicast traffic to a single class where the
data can get handled very quickly.

I have the code working now using the socket->async_receive_from() method
but the system is getting bogged down handling a large number of software
interrupts. 51% of the CPU time is spent handling software interrupts.

I create each multicast socket (up to 500 of them) like so:

socket = new udp::socket(io_service);

socket->open(listenEndPoint.protocol());

socket->set_option(boost::asio::ip::udp::socket::resuse_address(true));

socket->bind(listenEndPoint);

socket->set_option(boost::asio::ip::multicast::join_group(multicastAddress.to_v4()));

Slightly after that I register for data like so:

socket->async_receive_from(buffer,senderEndPoint,boost::bind(&EthernetCapture::receiveData,this,boost::asio::placeholders::bytes_transferred));

Is there a more efficient way to receive multicast data without incurring
so many software interrupts?

By the way this is for an application to run on 32 bit Linux for an
embedded application.

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