blocking.html 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  2. <HTML>
  3. <HEAD>
  4. <TITLE>Blocking</TITLE>
  5. <LINK REL="stylesheet" HREF="../../../../boost.css">
  6. <LINK REL="stylesheet" HREF="../theme/iostreams.css">
  7. </HEAD>
  8. <BODY>
  9. <!-- Begin Banner -->
  10. <H1 CLASS="title">Blocking</H1>
  11. <HR CLASS="banner">
  12. <!-- End Banner -->
  13. <H2>Description</H2>
  14. <P>
  15. A <A HREF="device.html">Device</A> is Blocking if a <CODE>read</CODE> request never produces fewer characters than requested except at end-of-stream, and if a <CODE>write</CODE> request never consumes fewer characters than requested under any circumstances. All Devices currently provided with the Iostreams library are Blocking. Limited support for non-Blocking Devices has been provided as a foundation for future more comprehensive support of <A HREF='../guide/asynchronous.html'>asynchronous and non-blocking i/o</A>.
  16. </P>
  17. <P>
  18. The Blocking concept does not apply to filters. Instead, filters are required to be <SPAN CLASS='term'>blocking-preserving</SPAN>, which means that
  19. </P>
  20. <UL>
  21. <LI>
  22. a <CODE>read</CODE> request never produces fewer characters than requested unless end-of-stream has been reached or unless a <CODE>read</CODE> request to a downsteam Source produces fewer characters than requested, and
  23. </LI>
  24. <LI>
  25. a <CODE>write</CODE> request never consumes fewer characters than requested unless a <CODE>write</CODE> request to a downsteam Sink consumes fewer characters than requested.
  26. </LI>
  27. </UL>
  28. <P>
  29. Unlike other Iostreams library concepts, Blocking is not associated with any <A HREF='../guide/traits.html#category_tags'>category tag</A>. In the future, a <CODE>non_blocking_tag</CODE> may be introduced.
  30. </P>
  31. <H2>Refinement of</H2>
  32. <P><A HREF="device.html">Device</A>.</P>
  33. <A NAME="types"></A>
  34. <H2>Associated Types</H2>
  35. <P>Same as <A HREF="device.html">Device</A>.</P>
  36. <A NAME="expressions"></A>
  37. <H2>Valid Expressions / Semantics</H2>
  38. <P>Valid expressions are the same as <A HREF="device.html">Device</A>. The additional semantic requirements are described informally above.</P>
  39. <!-- Begin Footer -->
  40. <HR>
  41. <P CLASS="copyright">&copy; Copyright 2008 <a href="http://www.coderage.com/" target="_top">CodeRage, LLC</a><br/>&copy; Copyright 2004-2007 <a href="https://www.boost.org/users/people/jonathan_turkanis.html" target="_top">Jonathan Turkanis</a></P>
  42. <P CLASS="copyright">
  43. Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at <A HREF="http://www.boost.org/LICENSE_1_0.txt">http://www.boost.org/LICENSE_1_0.txt</A>)
  44. </P>
  45. <!-- End Footer -->
  46. </BODY>