asio-users Mailing List for asio C++ library (Page 256)
Brought to you by:
chris_kohlhoff
You can subscribe to this list here.
2004 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
(6) |
Dec
|
---|---|---|---|---|---|---|---|---|---|---|---|---|
2005 |
Jan
|
Feb
|
Mar
(1) |
Apr
(3) |
May
|
Jun
|
Jul
|
Aug
|
Sep
(5) |
Oct
(7) |
Nov
(8) |
Dec
(11) |
2006 |
Jan
(11) |
Feb
(14) |
Mar
(8) |
Apr
(3) |
May
(27) |
Jun
(15) |
Jul
(43) |
Aug
(64) |
Sep
(19) |
Oct
(44) |
Nov
(69) |
Dec
(82) |
2007 |
Jan
(79) |
Feb
(153) |
Mar
(169) |
Apr
(148) |
May
(181) |
Jun
(114) |
Jul
(152) |
Aug
(104) |
Sep
(77) |
Oct
(128) |
Nov
(185) |
Dec
(215) |
2008 |
Jan
(100) |
Feb
(116) |
Mar
(115) |
Apr
(74) |
May
(152) |
Jun
(107) |
Jul
(117) |
Aug
(115) |
Sep
(141) |
Oct
(75) |
Nov
(31) |
Dec
(47) |
2009 |
Jan
(51) |
Feb
(65) |
Mar
(54) |
Apr
(60) |
May
(6) |
Jun
(107) |
Jul
(82) |
Aug
(133) |
Sep
(144) |
Oct
(11) |
Nov
(54) |
Dec
(26) |
2010 |
Jan
(30) |
Feb
(17) |
Mar
(93) |
Apr
(47) |
May
(93) |
Jun
(73) |
Jul
(32) |
Aug
(60) |
Sep
(59) |
Oct
(58) |
Nov
(71) |
Dec
(28) |
2011 |
Jan
(58) |
Feb
(65) |
Mar
(38) |
Apr
(83) |
May
(45) |
Jun
(70) |
Jul
(71) |
Aug
(7) |
Sep
(33) |
Oct
(65) |
Nov
(33) |
Dec
(16) |
2012 |
Jan
(13) |
Feb
(32) |
Mar
(30) |
Apr
(67) |
May
(57) |
Jun
(59) |
Jul
(8) |
Aug
(61) |
Sep
(48) |
Oct
(23) |
Nov
(29) |
Dec
(8) |
2013 |
Jan
(37) |
Feb
(20) |
Mar
(11) |
Apr
(11) |
May
(9) |
Jun
(26) |
Jul
(6) |
Aug
(18) |
Sep
(7) |
Oct
(29) |
Nov
(2) |
Dec
(17) |
2014 |
Jan
(11) |
Feb
(12) |
Mar
(6) |
Apr
(26) |
May
(17) |
Jun
(12) |
Jul
(12) |
Aug
|
Sep
(6) |
Oct
(3) |
Nov
|
Dec
(7) |
2015 |
Jan
(3) |
Feb
(3) |
Mar
(7) |
Apr
(23) |
May
|
Jun
(1) |
Jul
(2) |
Aug
(33) |
Sep
(16) |
Oct
(2) |
Nov
(2) |
Dec
(13) |
2016 |
Jan
(7) |
Feb
(22) |
Mar
(11) |
Apr
|
May
(10) |
Jun
(2) |
Jul
(3) |
Aug
(2) |
Sep
(1) |
Oct
(29) |
Nov
(3) |
Dec
(21) |
2017 |
Jan
(4) |
Feb
(31) |
Mar
(8) |
Apr
(4) |
May
(1) |
Jun
(4) |
Jul
(32) |
Aug
(28) |
Sep
(2) |
Oct
(11) |
Nov
(1) |
Dec
|
2018 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(10) |
Oct
|
Nov
(4) |
Dec
(20) |
2019 |
Jan
(3) |
Feb
|
Mar
(1) |
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
|
Nov
(1) |
Dec
|
2020 |
Jan
(2) |
Feb
(1) |
Mar
|
Apr
(2) |
May
(1) |
Jun
|
Jul
(11) |
Aug
(2) |
Sep
(6) |
Oct
|
Nov
|
Dec
|
2021 |
Jan
|
Feb
(1) |
Mar
(1) |
Apr
|
May
(2) |
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
(1) |
2022 |
Jan
|
Feb
(2) |
Mar
|
Apr
|
May
|
Jun
(4) |
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
(1) |
Dec
|
2023 |
Jan
(3) |
Feb
|
Mar
(5) |
Apr
(3) |
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(4) |
2024 |
Jan
|
Feb
(3) |
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
(1) |
Aug
(6) |
Sep
(1) |
Oct
|
Nov
|
Dec
|
From: Alex O. <ot...@je...> - 2006-07-14 06:00:28
|
Hello Christopher Yep, my code now running at work - i had updated to the latest CVS and now it works Christopher Kohlhoff wrote: > Hi Alex, > > Alex Ott <ot...@je...> wrote: > >> I had run you code on my home computer, and it works fine. my >> code, that was broken, also run fine with in_avail function. >> Now i try to understand, why it throw exception on my work >> computer, may be i need to update my boost distro (home i had >> tried boost from cvs) >> > > Any luck trying it again at work? Did you manage to work out > what was different? > > Cheers, > Chris > > > > > ------------------------------------------------------------------------- > Using Tomcat but need to do more? Need to support web services, security? > Get stuff done quickly with pre-integrated technology to make your job easier > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 > _______________________________________________ > asio-users mailing list > asi...@li... > https://lists.sourceforge.net/lists/listinfo/asio-users > -- With best wishes, Alex Ott Jet Infosystems, Head of software development group, MBA +7 (495) 411 76 01 http://www.jetsoft.ru/ |
From: Jose <jm...@gm...> - 2006-07-13 16:22:36
|
On 7/13/06, Christopher Kohlhoff <ch...@ko...> wrote: > > > A Multi-Threaded PIPELINED Web Server Architecture for SMP/SoC > > machines http://www2005.org/cdrom/docs/p730.pdf > > Interesting. I would have thought that passing the work for a > single request between many different threads would incur more > costs due to the context switches, but you never know! Apparently there are cache savings with the pipelined approach and synchronization savings by using few threads vs the standard MT approach with a large number of threads |
From: Christopher K. <ch...@ko...> - 2006-07-13 12:42:26
|
Hi Jose, Jose <jm...@gm...> wrote: > I think HTTP is the protocol. You already have the > single-threaded server example and might want to add the two > thread-based cases you describe above (and even a thread-pool > only example with no asio just for comparison) Yeah, an implementation of the same HTTP server with many different designs does sound like a good idea. Not something I'll have time for in the next few months though :) > For SMP and SoC architectures there is a pipelined > architecture that makes a difference (it relies on a 7 thread > pool for each processor) but am not sure how this could be > implemented with asio+threads > > A Multi-Threaded PIPELINED Web Server Architecture for SMP/SoC > machines http://www2005.org/cdrom/docs/p730.pdf Interesting. I would have thought that passing the work for a single request between many different threads would incur more costs due to the context switches, but you never know! It could be implemented in asio using an io_service object for each task -- it's not really that different in principle to the design of having an io_service per processor, you'd just have a pool of io_service objects per processor instead. > As for a simple example that requires the use of strands you > could do something as simple as a counter where each request > increments it (from any thread that handled the request) and > returns the value in the response Yeah, something like that might do for now. For something that's a really good showcase for strands I was thinking a full-duplex protocol (compared to HTTP 1.0 which is only half duplex and could be written without explicit strand objects). But perhaps an implementation of an HTTP server that supports pipelined requests could be enough. An HTTP proxy that supports pipelining would be even better. Cheers, Chris |
From: Christopher K. <ch...@ko...> - 2006-07-13 12:30:02
|
Hi Alex, Alex Ott <ot...@je...> wrote: > I had run you code on my home computer, and it works fine. my > code, that was broken, also run fine with in_avail function. > Now i try to understand, why it throw exception on my work > computer, may be i need to update my boost distro (home i had > tried boost from cvs) Any luck trying it again at work? Did you manage to work out what was different? Cheers, Chris |
From: Jose <jm...@gm...> - 2006-07-13 08:43:21
|
On 7/7/06, Christopher Kohlhoff <ch...@ko...> wrote: > > However, as Alex pointed out, I do need some examples that show > how to create multithreaded servers. I'll have to think about > what's a good protocol to use that's realistic, would actually > benefit from threads, require the use of strands, but is still > simple enough for an example. Suggestions? > Hi Chris, I think HTTP is the protocol. You already have the single-threaded server example and might want to add the two thread-based cases you describe above (and even a thread-pool only example with no asio just for comparison) For SMP and SoC architectures there is a pipelined architecture that makes a difference (it relies on a 7 thread pool for each processor) but am not sure how this could be implemented with asio+threads A Multi-Threaded PIPELINED Web Server Architecture for SMP/SoC machines http://www2005.org/cdrom/docs/p730.pdf As for a simple example that requires the use of strands you could do something as simple as a counter where each request increments it (from any thread that handled the request) and returns the value in the response regards |
From: Alex O. <ot...@je...> - 2006-07-08 11:47:09
|
Hallo Christopher I had run you code on my home computer, and it works fine. my code, that was broken, also run fine with in_avail function. Now i try to understand, why it throw exception on my work computer, may be i need to update my boost distro (home i had tried boost from cvs) Christopher Kohlhoff wrote: > Hi Alex, > > Alex Ott <ot...@je...> wrote: > >> I use following code. osocket - server socket, sock - pointer >> to client socket >> >> // write analyzed data from buffer >> boost::asio::write(*sock,responce); >> // here is exception with description Success >> std::size_t rl=osocket.in_avail(boost::asio::assign_error(error)); >> >> // translate data between server and proxy >> // here processing is hanging if all data already readed from server >> while(boost::asio::read(osocket, responce, >> boost::asio::transfer_at_least(1), >> boost::asio::assign_error(error))) { >> boost::asio::write(*sock,responce); >> } >> > > I can't reproduce either of these problems with a simple test > program (shown below). Do you have a complete program you can > send that shows the problem? What platform are you running on? > > Cheers, > Chris > > ----------------------- > > #include <asio.hpp> > #include <iostream> > > using asio::ip::tcp; > > int main() > { > try > { > asio::io_service io_service; > > tcp::endpoint listen_endpoint(tcp::v4(), 0); > tcp::acceptor acceptor(io_service, listen_endpoint); > std::cout << "Listening on " << acceptor.local_endpoint() << "\n"; > > tcp::socket client_socket(io_service); > acceptor.accept(client_socket); > > tcp::endpoint remote_endpoint(asio::ip::address_v4::loopback(), 8085); > tcp::socket server_socket(io_service); > server_socket.connect(remote_endpoint); > > asio::streambuf request; > std::ostream request_stream(&request); > request_stream << "GET / HTTP/1.0\r\n\r\n"; > asio::write(server_socket, request); > > asio::streambuf response; > asio::error error; > while (asio::read(server_socket, response, > asio::transfer_at_least(1), asio::assign_error(error))) > { > asio::write(client_socket, response); > std::size_t in_avail = server_socket.in_avail(asio::assign_error(error)); > std::cout << "In avail = " << in_avail << "\n"; > std::cout << "Error = " << error << "\n"; > } > > std::size_t in_avail = server_socket.in_avail(asio::assign_error(error)); > std::cout << "In avail = " << in_avail << "\n"; > std::cout << "Error = " << error << "\n"; > } > catch (std::exception& e) > { > std::cout << "Exception: " << e.what() << "\n"; > } > > return 0; > } > > > > Using Tomcat but need to do more? Need to support web services, security? > Get stuff done quickly with pre-integrated technology to make your job easier > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 > _______________________________________________ > asio-users mailing list > asi...@li... > https://lists.sourceforge.net/lists/listinfo/asio-users > -- With best wishes, Alex Ott Jet Infosystems, Head of software development group, MBA +7 (495) 411 76 01 http://www.jetsoft.ru/ |
From: Alex O. <ot...@je...> - 2006-07-07 13:17:57
|
Thanks for help, i tried to run example in monday, when i'll at work, and will have all needed infrastructure Christopher Kohlhoff wrote: > Hi Alex, > > Alex Ott <ot...@je...> wrote: > >> I use following code. osocket - server socket, sock - pointer >> to client socket >> >> // write analyzed data from buffer >> boost::asio::write(*sock,responce); >> // here is exception with description Success >> std::size_t rl=osocket.in_avail(boost::asio::assign_error(error)); >> >> // translate data between server and proxy >> // here processing is hanging if all data already readed from server >> while(boost::asio::read(osocket, responce, >> boost::asio::transfer_at_least(1), >> boost::asio::assign_error(error))) { >> boost::asio::write(*sock,responce); >> } >> > > I can't reproduce either of these problems with a simple test > program (shown below). Do you have a complete program you can > send that shows the problem? What platform are you running on? > > Cheers, > Chris > > ----------------------- > > #include <asio.hpp> > #include <iostream> > > using asio::ip::tcp; > > int main() > { > try > { > asio::io_service io_service; > > tcp::endpoint listen_endpoint(tcp::v4(), 0); > tcp::acceptor acceptor(io_service, listen_endpoint); > std::cout << "Listening on " << acceptor.local_endpoint() << "\n"; > > tcp::socket client_socket(io_service); > acceptor.accept(client_socket); > > tcp::endpoint remote_endpoint(asio::ip::address_v4::loopback(), 8085); > tcp::socket server_socket(io_service); > server_socket.connect(remote_endpoint); > > asio::streambuf request; > std::ostream request_stream(&request); > request_stream << "GET / HTTP/1.0\r\n\r\n"; > asio::write(server_socket, request); > > asio::streambuf response; > asio::error error; > while (asio::read(server_socket, response, > asio::transfer_at_least(1), asio::assign_error(error))) > { > asio::write(client_socket, response); > std::size_t in_avail = server_socket.in_avail(asio::assign_error(error)); > std::cout << "In avail = " << in_avail << "\n"; > std::cout << "Error = " << error << "\n"; > } > > std::size_t in_avail = server_socket.in_avail(asio::assign_error(error)); > std::cout << "In avail = " << in_avail << "\n"; > std::cout << "Error = " << error << "\n"; > } > catch (std::exception& e) > { > std::cout << "Exception: " << e.what() << "\n"; > } > > return 0; > } > > > > Using Tomcat but need to do more? Need to support web services, security? > Get stuff done quickly with pre-integrated technology to make your job easier > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 > _______________________________________________ > asio-users mailing list > asi...@li... > https://lists.sourceforge.net/lists/listinfo/asio-users > -- With best wishes, Alex Ott Jet Infosystems, Head of software development group, MBA +7 (495) 411 76 01 http://www.jetsoft.ru/ |
From: Christopher K. <ch...@ko...> - 2006-07-07 13:09:04
|
Hi Alex, Alex Ott <ot...@je...> wrote: > I use following code. osocket - server socket, sock - pointer > to client socket > > // write analyzed data from buffer > boost::asio::write(*sock,responce); > // here is exception with description Success > std::size_t rl=osocket.in_avail(boost::asio::assign_error(error)); > > // translate data between server and proxy > // here processing is hanging if all data already readed from server > while(boost::asio::read(osocket, responce, > boost::asio::transfer_at_least(1), > boost::asio::assign_error(error))) { > boost::asio::write(*sock,responce); > } I can't reproduce either of these problems with a simple test program (shown below). Do you have a complete program you can send that shows the problem? What platform are you running on? Cheers, Chris ----------------------- #include <asio.hpp> #include <iostream> using asio::ip::tcp; int main() { try { asio::io_service io_service; tcp::endpoint listen_endpoint(tcp::v4(), 0); tcp::acceptor acceptor(io_service, listen_endpoint); std::cout << "Listening on " << acceptor.local_endpoint() << "\n"; tcp::socket client_socket(io_service); acceptor.accept(client_socket); tcp::endpoint remote_endpoint(asio::ip::address_v4::loopback(), 8085); tcp::socket server_socket(io_service); server_socket.connect(remote_endpoint); asio::streambuf request; std::ostream request_stream(&request); request_stream << "GET / HTTP/1.0\r\n\r\n"; asio::write(server_socket, request); asio::streambuf response; asio::error error; while (asio::read(server_socket, response, asio::transfer_at_least(1), asio::assign_error(error))) { asio::write(client_socket, response); std::size_t in_avail = server_socket.in_avail(asio::assign_error(error)); std::cout << "In avail = " << in_avail << "\n"; std::cout << "Error = " << error << "\n"; } std::size_t in_avail = server_socket.in_avail(asio::assign_error(error)); std::cout << "In avail = " << in_avail << "\n"; std::cout << "Error = " << error << "\n"; } catch (std::exception& e) { std::cout << "Exception: " << e.what() << "\n"; } return 0; } |
From: Alex O. <ot...@je...> - 2006-07-07 13:04:14
|
boost::asio::streambuf - i had read data into it with read_until, before read. But exception is in in_avail, not in read Christopher Kohlhoff wrote: > Alex Ott <ot...@je...> wrote: > > >> // translate data between server and proxy >> // here processing is hanging if all data already readed from server >> while(boost::asio::read(osocket, responce, >> boost::asio::transfer_at_least(1), >> boost::asio::assign_error(error))) { >> boost::asio::write(*sock,responce); >> } >> > > What is the type of the variable called "responce"? > > > > Using Tomcat but need to do more? Need to support web services, security? > Get stuff done quickly with pre-integrated technology to make your job easier > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 > _______________________________________________ > asio-users mailing list > asi...@li... > https://lists.sourceforge.net/lists/listinfo/asio-users > -- With best wishes, Alex Ott Jet Infosystems, Head of software development group, MBA +7 (495) 411 76 01 http://www.jetsoft.ru/ |
From: Christopher K. <ch...@ko...> - 2006-07-07 11:35:52
|
Alex Ott <ot...@je...> wrote: > // translate data between server and proxy > // here processing is hanging if all data already readed from server > while(boost::asio::read(osocket, responce, > boost::asio::transfer_at_least(1), > boost::asio::assign_error(error))) { > boost::asio::write(*sock,responce); > } What is the type of the variable called "responce"? |
From: Alex O. <ot...@je...> - 2006-07-07 10:20:51
|
Hello Christopher Kohlhoff wrote: > Alex Ott <ot...@je...> wrote: > >> I playing with asio and writing proxy. sometimes i don't know >> how many bytes will send from server to client, and wait for >> it in read-write loop. But sometimes, i already had readed >> data into the buffer, and my work stop until the timeout, >> waiting for data. >> > > Presumably you are doing something like: > > asio::read(sock, asio::buffer(buf)); > > This usage of asio::read (or the equivalent asio::async_read > call) does not finish until the buffer is full or an error > occurs. > > See example of code at the end of mail >> I had tried to use in_avail function, but it always throw >> exception, instead of assigning error value to variable. Why >> it do this? >> > > I don't know why it would fail at all: what is the error code > contained inside the exception object? How are you trying to use > it? > > Success >> And may be somebody give me a answer, what the best strategy >> to process data of unknown sizes? >> > > Either: > > - Use sock.read_some() (or equivalent sock.async_read_some() > function), which will complete after one or more bytes as > been read. > > or ... > > - Use the following form of asio::read(): > > size_t bytes_read = asio::read( > sock, asio::buffer(buf), > asio::transfer_at_least(1)); > > or ... > > - If the data is terminated by some sort of delimiter, use > asio::read_until(). > > I use following code. osocket - server socket, sock - pointer to client socket // write analyzed data from buffer boost::asio::write(*sock,responce); // here is exception with description Success std::size_t rl=osocket.in_avail(boost::asio::assign_error(error)); // translate data between server and proxy // here processing is hanging if all data already readed from server while(boost::asio::read(osocket, responce, boost::asio::transfer_at_least(1), boost::asio::assign_error(error))) { boost::asio::write(*sock,responce); } -- With best wishes, Alex Ott Jet Infosystems, Head of software development group, MBA +7 (495) 411 76 01 http://www.jetsoft.ru/ |
From: Christopher K. <ch...@ko...> - 2006-07-07 09:51:42
|
Alex Ott <ot...@je...> wrote: > I playing with asio and writing proxy. sometimes i don't know > how many bytes will send from server to client, and wait for > it in read-write loop. But sometimes, i already had readed > data into the buffer, and my work stop until the timeout, > waiting for data. Presumably you are doing something like: asio::read(sock, asio::buffer(buf)); This usage of asio::read (or the equivalent asio::async_read call) does not finish until the buffer is full or an error occurs. > I had tried to use in_avail function, but it always throw > exception, instead of assigning error value to variable. Why > it do this? I don't know why it would fail at all: what is the error code contained inside the exception object? How are you trying to use it? > And may be somebody give me a answer, what the best strategy > to process data of unknown sizes? Either: - Use sock.read_some() (or equivalent sock.async_read_some() function), which will complete after one or more bytes as been read. or ... - Use the following form of asio::read(): size_t bytes_read = asio::read( sock, asio::buffer(buf), asio::transfer_at_least(1)); or ... - If the data is terminated by some sort of delimiter, use asio::read_until(). Cheers, Chris |
From: Alex O. <ot...@je...> - 2006-07-07 07:41:28
|
Hello Christopher Kohlhoff wrote: > Alex Ott <ot...@je...> wrote: > >> as i remember - in previous versions of tutorial was good part >> about what is asio buffers, what types exists, etc. may be >> restore this part in docs? >> > > I don't remember removing any docs to do with buffers. Could > this be the page you're thinking of?: > > <http://asio.sourceforge.net/boost_asio_0_3_7/libs/asio/doc/reference/a00268.html> > > Good. But may be include this intro to the tutorial? -- With best wishes, Alex Ott Jet Infosystems, Head of software development group, MBA +7 (495) 411 76 01 http://www.jetsoft.ru/ |
From: Christopher K. <ch...@ko...> - 2006-07-07 07:34:22
|
Hi Alex, Alex Ott <ot...@je...> wrote: > as i remember - in previous versions of tutorial was good part > about what is asio buffers, what types exists, etc. may be > restore this part in docs? I don't remember removing any docs to do with buffers. Could this be the page you're thinking of?: <http://asio.sourceforge.net/boost_asio_0_3_7/libs/asio/doc/reference/a00268.html> > Now i working on the http proxy example - i have sync version, > and plan to write async one. I think, that it would be good > example, as it shows usage of different functions in one > example Great, looking forward to seeing it! Cheers, Chris |
From: Alex O. <ot...@je...> - 2006-07-07 07:34:16
|
I playing with asio and writing proxy. sometimes i don't know how many bytes will send from server to client, and wait for it in read-write loop. But sometimes, i already had readed data into the buffer, and my work stop until the timeout, waiting for data. I had tried to use in_avail function, but it always throw exception, instead of assigning error value to variable. Why it do this? And may be somebody give me a answer, what the best strategy to process data of unknown sizes? -- With best wishes, Alex Ott Jet Infosystems, Head of software development group, MBA +7 (495) 411 76 01 http://www.jetsoft.ru/ |
From: Alex O. <ot...@je...> - 2006-07-07 06:42:52
|
Hi all as i remember - in previous versions of tutorial was good part about what is asio buffers, what types exists, etc. may be restore this part in docs? Now i working on the http proxy example - i have sync version, and plan to write async one. I think, that it would be good example, as it shows usage of different functions in one example -- With best wishes, Alex Ott Jet Infosystems, Head of software development group, MBA +7 (495) 411 76 01 http://www.jetsoft.ru/ |
From: Christopher K. <ch...@ko...> - 2006-07-06 23:00:22
|
Jose <jm...@gm...> wrote: > Do you plan to provide the performance examples in the boost > distribution (using boost.threads) ? Probably not in their current form. I intend to develop a new set of benchmark programs that automatically execute a range of different tests (throughput, latency, connections-per-second, etc) while varying different parameters (number of live and dead connections, message size, number of threads, etc). These programs will automatically generate raw data suitable for plugging into something like Excel to create graphs and so on. However, as Alex pointed out, I do need some examples that show how to create multithreaded servers. I'll have to think about what's a good protocol to use that's realistic, would actually benefit from threads, require the use of strands, but is still simple enough for an example. Suggestions? Cheers, Chris |
From: Christopher K. <ch...@ko...> - 2006-07-06 22:45:18
|
Jose <jm...@gm...> wrote: > It looks like basic_streambuf.hpp has all the code duplicated. Fixed, thanks! Looks like I got a bit too enthusiastic with a copy-and-paste. At least since it duplicated the include guard as well it should have been harmless. Cheers, Chris |
From: Jose <jm...@gm...> - 2006-07-06 12:57:59
|
On 7/6/06, Christopher Kohlhoff <ch...@ko...> wrote: > > See the performance test programs > included in the non-boost distribution for an example showing > multithreaded client and server programs that use strands: > > <http://asio.cvs.sourceforge.net/asio/asio/src/tests/performance/> Hi Chris, Do you plan to provide the performance examples in the boost distribution (using boost.threads) ? regards |
From: Jose <jm...@gm...> - 2006-07-06 12:49:48
|
It looks like basic_streambuf.hpp has all the code duplicated. regards |
From: Christopher K. <ch...@ko...> - 2006-07-06 09:59:11
|
Alex Ott <ot...@je...> wrote: > include/asio/detail/reactive_socket_service.hpp:77: error: comma at end > of enumerator list I just committed the fix to asio's CVS repository. Thanks! |
From: Christopher K. <ch...@ko...> - 2006-07-06 09:54:14
|
Hi Alex, Alex Ott <ot...@je...> wrote: > I look to asio and it seems very good. but documentation > covers to few examples/topics. I understand how to implement > single threaded async servers. But has anybody example of > multithreaded servers? I want to write this one, that will run > on multikernel CPU's. There are probably two main approaches to using asio's asynchronous operations in multithreaded servers: 1) Run a pool of threads against a single io_service object. You can do this by calling io_service::run() from multiple threads. Since your handlers can now be called from different threads, you might also want to protect access to shared data using a strand object. See the tutorial program Timer.5 for a very simple example showing how to use strands. See the performance test programs included in the non-boost distribution for an example showing multithreaded client and server programs that use strands: <http://asio.cvs.sourceforge.net/asio/asio/src/tests/performance/> 2) Use a pool of io_service objects, with one thread per io_service object. As an example you might have one io_service object per CPU. This approach removes the need for synchronisation using strand objects, since it's really like having multiple single threaded servers. When objects associated with different io_service objects need to communicate they should use io_service::post() to send messages. The first approach should spread the load more evenly across multiple CPUs when the system is heavily loaded. However the second approach keeps the work associated with each io_service object independent, as well as eliminating the synchronisation cost of strand objects, and so is likely to better scale to utilise many CPUs. Cheers, Chris |
From: Christopher K. <ch...@ko...> - 2006-07-06 09:36:36
|
Hi David, David J. Fiddes <D....@fi...> wrote: > Are there any plans to add file system support to asio? It > seems that there is a lot of common infrastructure in asio > that would be really useful for both network and file IO. Felipe Magno de Almeida <fel...@gm...> has been working on some async file I/O support for asio. You might want to get in touch and see where it's up to. Hopefully it will be added into a future version of asio -- probably after whatever is included in boost 1.35, however. Cheers, Chris |
From: Alex O. <ot...@je...> - 2006-07-05 12:31:23
|
include/asio/detail/reactive_socket_service.hpp:77: error: comma at end of enumerator list -- With best wishes, Alex Ott Jet Infosystems, Head of software development group, MBA +7 (495) 411 76 01 http://www.jetsoft.ru/ |
From: Alex O. <ot...@je...> - 2006-07-05 05:39:49
|
Hi all I look to asio and it seems very good. but documentation covers to few examples/topics. I understand how to implement single threaded async servers. But has anybody example of multithreaded servers? I want to write this one, that will run on multikernel CPU's. -- With best wishes, Alex Ott Jet Infosystems, Head of software development group, MBA +7 (495) 411 76 01 http://www.jetsoft.ru/ |