Questions tagged [overlapped-io]

138 questions
55
votes
4 answers

Is there really no asynchronous block I/O on Linux?

Consider an application that is CPU bound, but also has high-performance I/O requirements. I'm comparing Linux file I/O to Windows, and I can't see how epoll will help a Linux program at all. The kernel will tell me that the file descriptor is…
Jon Watte
  • 6,579
  • 4
  • 53
  • 63
19
votes
1 answer

Explanation for tiny reads (overlapped, buffered) outperforming large contiguous reads?

(apologies for the somewhat lengthy intro) During development of an application which prefaults an entire large file (>400MB) into the buffer cache for speeding up the actual run later, I tested whether reading 4MB at a time still had any noticeable…
Damon
  • 67,688
  • 20
  • 135
  • 185
15
votes
3 answers

Why is it called Overlapped I/O?

All I can find is tutorials on how to use Overlapped I/O, but I can't find why is it called like that. Is it because for example I can read something from a socket, and then read something else before necessarily the first read returns the bytes…
user4407915
15
votes
7 answers

Is it possible to change HANDLE that has been opened for synchronous I/O to be opened for asynchronous I/O during its lifetime?

Most of my daily programming work in Windows is nowadays around I/O operations of all kind (pipes, consoles, files, sockets, ...). I am well aware of different methods of reading and writing from/to different kinds of handles (Synchronous,…
9
votes
2 answers

Named Pipes - Asynchronous Peeking

I need to find a way to be notified when a System.IO.Pipe.NamedPipeServerStream opened in asynchronous mode has more data available for reading on it- a WaitHandle would be ideal. I cannot simply use BeginRead() to obtain such a handle because it's…
KJ Tsanaktsidis
  • 1,255
  • 1
  • 17
  • 28
8
votes
1 answer

Using overlapped IO for console input?

I'm attempting to use overlapped IO to read input from the console by opening CONIN$ with the FILE_FLAG_OVERLAPPED flag. However, ReadFile blocks when I use it, even with an OVERLAPPED parameter. I've read some posts reporting that this is a…
Connor Worley
  • 83
  • 1
  • 4
8
votes
2 answers

ConnectEx requires the socket to be "initially bound", but to what?

The ConnectEx function requires an "unconnected, previously bound socket". Indeed, if I omit the bind step in my example (see below), ConnectEx fails with WSAEINVAL. Here's my current understanding: before calling ConnectEx, bind the socket to…
Joey Adams
  • 41,996
  • 18
  • 86
  • 115
6
votes
0 answers

Why CompletionKey in I/O completion port?

Remark from MSDN about CompletionKey in CreateIoCompletionPort function: Use the CompletionKey parameter to help your application track which I/O operations have completed. This value is not used by CreateIoCompletionPort for functional…
Y.Z
  • 626
  • 2
  • 9
  • 21
6
votes
1 answer

Asynchronous File I/O via POSIX AIO or Windows Overlapped IO in Java

System.IO.File in .NET and .NET Core has a family of Read...Async() methods, all of which return either Task or Task (Task is the .NET's equivalent of Java's Future). This looks largely equivalent to AsynchronousFileChannel…
Bass
  • 4,977
  • 2
  • 36
  • 82
6
votes
2 answers

How to call DeviceIOControl code asynchronously?

I am trying to call DeviceIO functions asynchronously by using the OVERLAPPED structure as described on MSDN. I am using the FSCTL_ENUM_USN_DATA control code to enumerate the MFT of NTFS drives but i am not able to run it asynchronously. The file…
5
votes
3 answers

Windows NAmed Pipes alternative in Linux

We are porting existing windows code to Linux. We are using ACE as abstraction layer. We are using windows named pipes for communicating with multiple clients and to perform overlapped operations . What is the equivalent to this in linux. I have…
Sirish
  • 9,183
  • 22
  • 72
  • 107
5
votes
2 answers

Timer that supports overlapped I/O (for IOCP)?

I need to add timers support in an application based on I/O Completion Ports (IOCP). I would like to avoid the use of a specific thread to manage timers. On Linux, you can create a timer that delivers expiration notifications via a file descriptor…
Cédrics
  • 1,974
  • 11
  • 13
5
votes
2 answers

When are IO completion port packets sent and when not?

I'm currently working on an IPC mechanism based on named pipes using a IO completion port. Unfortunately I have some troubles with the msdn documentation because it's quite unclear to me in which cases calls to ReadFile/WriteFile result in a…
5
votes
1 answer

Read lines from file async using WINAPI ReadFile

I need to read several lines from file simultaneously, i.e. asynchronously. Lines in file are of the same size. For instance, I need to read the second and the fourth lines of file to separate variables or to an array. I'm more used to c#'s…
Denis Yakovenko
  • 3,241
  • 6
  • 48
  • 82
4
votes
2 answers

Writing synchronously to a file opened with FILE_FLAG_OVERLAPPED

I have opened a file using HANDLE handle= CreateFileW( fileName, GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, FILE_FLAG_OVERLAPPED, NULL); The file handle is then used for asynchronous read…
Etan
  • 17,014
  • 17
  • 89
  • 148
1
2 3
9 10