Hey Pete,<br><br><div><span class="gmail_quote">On 15/08/07, <b class="gmail_sendername"><a href="mailto:pete@mu.org">pete@mu.org</a></b> &lt;<a href="mailto:pete@mu.org">pete@mu.org</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
The docs are pretty specific that you can either have a global<br>io_service and then have each thread call run from within each on,<br>or you can have a an io_service for each thread.</blockquote><div><br>IIUC, you can mix and match too (see the HTTP3 example, which uses an io_service pool). In your case, having a pool of io_services, each being run in a pool of threads might help you.
<br></div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">I have tried both. Both have the same issue.&nbsp;&nbsp;If I use standard low level sockets, my
<br>app runs very fast and concurrency pays off, but with asio it&#39;s a<br>dog that runs our of resources.</blockquote><div><br>Are you using Linux 2.4? According to the docs, you are limited to FD_SETSIZE number of sockets. Can you check what that is defined as on your system? You shouldn&#39;t run into this problem a newer Linux kernel, as that uses epoll, which apparently doesn&#39;t have the same limitations.
<br></div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">&lt;snip&gt;&nbsp; <br></blockquote><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
All I want to do is launch hundreds of threads to make these connections<br>and asio doesn&#39;t seem to permit that sort of abuse.</blockquote><div><br>Asio should allow that sort of abuse. Can you provide more details about your system?
<br><br>As an aside, if you fork() before running your &#39;main loop&#39;, you can get around the FD_SETSIZE limit (which is a per-process one).<br><br>Regards,<br>Darren<br></div><br></div>