receive handler priority

Alexander CarĂ´t via Boost-users <[email protected]> Wed, 28 Dec 2022 12:56:23 +0100
Newsgroups gmane.comp.lib.boost.user
Message-ID <trinity-d06be0e4-cc27-4f3e-b507-c05bcf84d219-1672228583404@3c-app-gmx-bap32>
Hello all,

I have a classical receive handling structure for an asynchronous UDP socket:

void receiver::receive(){
    mySocket->async_receive_from(
        boost::asio::buffer(input, maxInputLength), senderEndpoint,
        boost::bind(&receiver::handleReceiveFrom, this,
                    boost::asio::placeholders::error,
                    boost::asio::placeholders::bytes_transferred));
}

void receiver::handleReceiveFrom(const boost::system::error_code &error,
                                 size_t bytes_recvd) {

   // SPECIFIC CODE HERE AND FINAK CALL OF RECEIVE FUNCTION

    this->receive();
}

Besides this my app works with several realtime threads I have assigned maximum priority to via:

pthread_t threadID = (pthread_t) sendThread.native_handle();
struct sched_param param;
int policy = SCHED_FIFO;
int max = sched_get_priority_max(policy);
param.sched_priority = max;
pthread_setschedparam(threadID, policy, &param);

Now I wonder in how far these realtime threads can have an impact on the performance of my receiver process: So far I assumed that the receiver handle code is executed immediately when a packet arrives at the NIC but I am not sure if other realtime threads might possibly delay this process when scheduled first.

In other words: If we think of the receiver handling process as a thread that is triggered by incoming packets does this thread also have realtime capabilities that can suffer from competing processes ?

Thanks in advance for clarification,
best

Alex

--
http://www.carot.de
Email : [email protected]
Tel.: +49 (0)177 5719797