Boost logo

Boost Users :

Subject: [Boost-users] [Asio] Why does Boost Asio only allow 64 buffers to be sent/recei ved using scatter/gather?
From: Stephens Patrick (patrick.stephens_at_[hidden])
Date: 2009-09-16 08:42:16


Hi all,

Apologies if this question should be directed at an Asio-specific list but I
could not see one.

I am curious why the Boost Asio library specifies a maximum of 64 buffers
can be used for scatter/gather operations? I would like to gain a better
understanding as to why this value was used.

The documentation
(http://www.boost.org/doc/libs/1_40_0/doc/html/boost_asio/overview/implement
ation.html), and the code backs it up, seems to specify that the maximum
allowed will be 'min(64, IOV_MAX)' for linux implementations.

Was this value (64) chosen for some particular reason?
What would the consequences be of using IOV_MAX if it was greater than 64?

I see that the Windows NT, 2000, XP, 2003 and Vista implementation also has
a limit of 64 so is this something limited by the OS or to keep it
consistent across all the Asio implementations?

I had a look around to see if there was a restriction under Windows but the
only documentation I could find
(http://msdn.microsoft.com/en-us/library/ms742203%28VS.85%29.aspx) mentions
that it is restricted to a value of 16 under Windows 95, 98 and ME, which
does tally with what the Asio documentation states in the link above.

Thanks for any help,
Pat.

This email, including any attachment, is a confidential communication
intended solely for the use of the individual or entity to whom it is
addressed. It contains information which is private and may be proprietary
or covered by legal professional privilege. If you have received this email
in error, please notify the sender upon receipt, and immediately delete it
from your system.

Anything contained in this email that is not connected with the businesses
of this company is neither endorsed by nor is the liability of this company.

Whilst we have taken reasonable precautions to ensure that any attachment to
this email has been swept for viruses, we cannot accept liability for any
damage sustained as a result of software viruses, and would advise that you
carry out your own virus checks before opening any attachment.


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