Boost logo

Boost Users :

From: pete_at_[hidden]
Date: 2007-08-09 17:09:10


Hi, I 've been doinking around with asio for a few weeks, and I've run
into an issue I can't seem to wrap my head around.

I've been playing with some code that originally was meant to pound
a server with a large amount of packets for benchmarking purposes.
It uses threads to launch hundreds of threads per second.

When I replaced the old socket code with asio, and used a single
io_service with run being called within each thread, I run out of
file descriptors very quickly, and if I use a single io_service
within each thread it's the same thing but the performance seems
worse. Needless to say, this seems like a real limitation and I'm
hoping I'm just being limited by my own misunderstanding, because
I'm really enjoying the portability of asio.

The docs that are there seem great, but there seems to be a lot more the
library can do that I am missing out on, and I think the docs seem like
they are not mentioning a lot of what asio an do.

Can someone point me in the right direction for launching 1-to-N threads
with a single send_to and a single receive_from within each thread that
doesn't take the hit I'm seeing?

It seems to me, that it's obvious that the io-service design is the
difference, because I don't get the issue at all when I use plain old
sockets, and the OS thread limit is then the only limitation.

Any help would be greatly appreciated. FYI, I've done most of my
experimenting on Linux and OSX.

Thanks,

Pete


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