Developer Guide and Reference

  • 0.6
  • 05/04/2020
  • Public Content
Contents

Template Class async_class

This topic only applies to Windows* OS.
Intel's C++ asynchronous I/O class implementation contains two main classes within the
async
namespace: the
async_class
template class and the
thread_control
base class.
The header/typedef definitions are as follows:
namespace async { template<class A> class async_class: public thread_control, public A }
The template class
async_class
inherits support for asynchronous execution of I/O operations that are integrated within the base
thread_control
class.
All functionality to control asynchronous execution of a queue of STL stream operations is encapsulated in the base class
thread_control
and is inherited by template class
async_class
.
In most cases it is enough to add the header file
aiostream.h
to the source file and declare the file object as an instance of the new template class
async:async_class
. The initial stream class must be the parameter for the template class. Consequently, the defined output operator
<<
and input operator
>>
are executed asynchronously.
The header file
aiostream.h
includes all necessary declarations for the STL stream I/O operations to add asynchronous functionality of the
thread_control
class. It also contains the necessary declarations of extensions for the standard C++ STL streams I/O operations: output operator
>>
and input operator
<<
.
You can call synchronization method
wait()
to wait for completion of any I/O operations with the file object. If the
wait()
method is not called explicitly, it is called implicitly in the object destructor.

Public Interface of Template Class async_class

The following methods define the public interface of the template class
async_class
:

Library Restrictions

Intel's C++ asynchronous I/O template class does not control the integrity or validity of the objects during asynchronous operation. Such control should be done by the user.
For application stability in the Visual Studio 2003 environment, link the C++ part of
libacaio.lib
library with multi-threaded
msvcrt
run-time library. Use
/MT
or
/MTd
compiler option.
1

Product and Performance Information

1

Intel's compilers may or may not optimize to the same degree for non-Intel microprocessors for optimizations that are not unique to Intel microprocessors. These optimizations include SSE2, SSE3, and SSSE3 instruction sets and other optimizations. Intel does not guarantee the availability, functionality, or effectiveness of any optimization on microprocessors not manufactured by Intel. Microprocessor-dependent optimizations in this product are intended for use with Intel microprocessors. Certain optimizations not specific to Intel microarchitecture are reservered for Intel microprocessors. Please refer to the applicable product User and Reference Guides for more information regarding the specific instruction sets covered by this notice.

Notice revision #20110804