I want to spawn a child process and capture its stdout (and stderr) using overlapped I/O without using threads. Here’s my current knowledge of all the stars that must align in order to achieve that, i.e. here’s the recipe: Set an inheritable handle as the stdout (and stderr) of the process when creating the process ..
Let’s say you’re doing an asynchronous operation (like ReadDirectoryChangesW) using I/O completion ports. And for each call to the function, you allocate an OVERLAPPED structure (perhaps with some additional data) for use within the I/O completion callback. And then within the callback, after the OVERLAPPED structure has been used, you free the memory using the ..
I am building a software which on the one side connects to a device with a FT601 using FTD3XX library and on the other side to another software via TCP/socket communication. I am using multiple threads – 1. TCP incoming data + USB outgoing data / 2. TCP outgoing data / 3. USB incoming data. ..
I am using WSASend() to send some data with IOCP. I allocate a buffer and fill it with data to send, then create a WSABUF pointing to my buffer and pass it into WSASend(). The documentation says: If this function is completed in an overlapped manner, it is the Winsock service provider’s responsibility to capture ..
I created an overlapped WriteFile scheme, where one thread fills a ring-buffer and advances the head-pointer and calls WriteFile, and another thread watches events from OVERLAPPED writes to advance the tail pointer. The logic is behaving as expected, but the file size is not increasing, it remains the same and just over-writes from position 0. ..
I am trying to understand why this code starts working slower with large 1.8 GB file when parts variable is increasing, so more reads and writes are performed in a single iteration. The function is below. In and out files are created with CreateFile() with FILE_FLAG_OVERLAPPED and FILE_FLAG_NO_BUFFERING flags. Time is measured for 8 KB ..
I have been tinkering with an open source project that has started making use of overlapped IO for sending data using the Winsock2 interfaces in one of its most recent versions. In the project’s past, one approach to improve the send performance of (old) blocking IO has been to increase the sendbuffer size (SO_SNDBUF) to ..