Boost logo

Boost Users :

Subject: Re: [Boost-users] BOOST ASIO relation between I/O Service and a Socket and a Thread
From: Igor R (boost.lists_at_[hidden])
Date: 2011-11-19 15:14:52


>    By going through ASIO, i find that the I/O Service gets run on a thread
> and the socket gets created with a I/O Service. So the data for the socket
> has to be always sent through the same thread. For trying take advantage of
> data localization, i am exploring whether it would be possible to have a
> thread per multi-core processor running the io_service::run() method.

You can run io_service::run in several threads, like in "HTTP Server 3" example:
http://www.boost.org/doc/libs/1_48_0/doc/html/boost_asio/examples.html

> I am just wondering there is a way where in i can change the io_service associated with the socket.

No, you can't move a socket to another io_service.


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