Are there asynchronous operations in c ++? Or any other means ...

I need to use the function from the standard library. This function returns control to the program only when data from the port comes into it. And if there is no data, then it will be so expected. Is it possible in c ++ to forcibly return control to the calling function?

  • one
    In C ++, no. In the system used (Windows? Linux? MAC OS X?) - is. C ++ has nothing to do with it. What is OS? - alexlz
  • @alexlz, Win XP - andrw
  • @andrw, If you are given an exhaustive answer, mark it as true. - Deleted
  • The new standard has std :: future and std :: async. - manking

1 answer 1

@andrw ReadFile allows you to perform both synchronous and asynchronous reading, ReadFileEx is specifically designed for asynchronous operations

In msdn about ReadFile:

This function is designed for both synchronous and asynchronous operations. For a similar function designed solely for asynchronous operation, see ReadFileEx. 
  • @alexlz, thanks!) What you need :) - andrw