|
Boost Users : |
From: pete_at_[hidden]
Date: 2007-08-15 11:55:45
On Wed, Aug 15, 2007 at 09:52:38AM +0200, Manuel Jung wrote:
> As far as i can tell it just makes sense to run different io_service
> objects, if you have a multicore system and want to use all cores to accept
> connections. This was discussed some time ago on the mailing list and i
> think they wanted to take a new example into asio to show, how its done.
Thanks a lot for the reply. However, I think I'm probably
miscommunicating the issue.
The docs are pretty specific that you can either have a global
io_service and then have each thread call run from within each on,
or you can have a an io_service for each thread. I have tried both.
Both have the same issue. If I use standard low level sockets, my
app runs very fast and concurrency pays off, but with asio it's a
dog that runs our of resources.
My test app is very simple it just tries to do as many hits on a
server within each thread with a single packet as possible and then
reads back the single reply.
However, it doesn't matter, because I'm using the io service, it limits
me from making new sockets because it's running out of file descriptors.
The connections are never made because it can't even create a socket.
On my standard 32bit linux system, it can't do more than 25 or 30
threads before asio honks.
All I want to do is launch hundreds of threads to make these connections
and asio doesn't seem to permit that sort of abuse. As this type of thing
might not be done normally, I can see why no one else might of seen it,
but certainly if a standard posix implementation can do it, then it
would seem asio should allow for that too.
ie., isn't there a way to just allow for me to use a bunch of send_to's
and recv_from's without the resouces running out so fast?
Does that make sense?
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