Jack
Jack

Reputation: 133

boost asynchronous (non-blocking) communication for data exchange among multi-threads

I am trying to do data-exchange communication among boost::threads.

Different threads need to exchange data with each other. Each thread represent a node at a network so that each thread needs to communicate its local data with its neighbor nodes at each iteration.

Are there asynchronous (non-blocking) communication APIs in boost to do this ?

For example,

non_block_send(receiver_address, data_buffer, data_volume, data_tag, send_status); 

non_block_recv(sender_address, data_buffer, data_volume, data_tag, recv_status);  

if (recv_status == TRUE)   
    getData(data_buffer); 
else
    wait;

Upvotes: 0

Views: 553

Answers (1)

dalle
dalle

Reputation: 18507

Take a look at Boost.Asio, a library designed for asynchronous IO.

Upvotes: 1

Related Questions