Boost logo

Boost Users :

Subject: Re: [Boost-users] [boost.asio] Concurrently Ping 1000+ Hosts
From: reminisc3_at_[hidden]
Date: 2013-12-19 20:05:45

Are fibers just inherently threads? I read that they have all of the member functions that boost.thread offers. The async functionality looks very useful . At the very least, a promising extension of boost.thread. 

On a side note, anybody have any idea how I can make the above code concurrent capable?  It may be impractical to accomplish what I'm trying to do but I'm feeling ambitious :) I could process all the pings in a loop with just one thread at a time and set the timeout at 500 ms. So it would take 3000 seconds to ping 3000 ip's. Just trying to be fast and efficient as possible. 

Nail, I am very interested in AFIO. I develop mainly for Windows and have recently began reading the msdn docs for completion ports, etc. There just doesn't seem to be many working examples and the documentation is weak. I posted on here a couple weeks ago trying to implement multithreaded io in a raid environment. I will be considering AFIO for sure.  

  Original Message  
From: Niall Douglas‎
Sent: Thursday, December 19, 2013 7:12 PM
To: boost-users_at_[hidden]
Reply To: boost-users_at_[hidden]
Subject: Re: [Boost-users] [boost.asio] Concurrently Ping 1000+ Hosts

On 19 Dec 2013 at 8:17, Oliver Kowalke wrote:

> // fiber gets suspended until message was read
> boost::asio::async_read(
> socket_,
> boost::asio::buffer( channel),
> yield[ec]);
> if ( ec) throw std::runtime_error("some error");
> // fiber gets suspended until message was written
> boost::asio::async_write(
> socket_,
> boost::asio::buffer( data_, max_length),
> yield[ec]);
> You can find more detailed infos in boost.fiber's docu:
> The library itself contains several examples demonstrating the usage
> together with boost.asio.

You just made me VERY interested in the forthcoming Fiber peer
review, thank you. AFIO's third worked example in its tutorial is a
peak performance "find in files" implementation and it, being
completely asynchronous right down to even enumerating directories,
is a mess of callbacks. I had assumed that was as good as it could

It looks possible that Fiber could replace much of that mess of
callbacks with something far more readable. You definitely have my
attention now, I may even have a crack at adding Fiber support to
AFIO, and see what happens. One again, thank you.


Currently unemployed and looking for work.
Work Portfolio:

Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at