BulkIoOptions struct
The shape of the overlapped I/O of AsyncFile::ReadFile and AsyncFile::WriteFile.
- Use
import ThinkMeta.ConcurrentTasks.AsyncIo.AsyncFile;- Namespace
ThinkMeta::ConcurrentTasks::AsyncIo
Syntax
struct BulkIoOptionsRemarks
What counts is the amount in flight (blockSize * blocksInFlight): below about 1 MB a fast disk waits for requests; measured cold on NVMe with four samples, 1 MB x 5 was best or as good as any other shape, and a block size that grows from small to large gave nothing over a fixed one. Out-of-range values are corrected, not rejected: blockSize 0 means DefaultBlockSize, and blocksInFlight is clamped to 1..MaxBlocksInFlight. The last block of ReadFile is shorter (the rest of the file); WriteFile blocks are whatever Memory::IReadSequentialMemory::RequestReadMemory hands out, at most blockSize. startOffset is used by ReadFile only (beyond the end it reads nothing); WriteFile always writes from offset 0.
See also
AsyncFile::ReadFile, AsyncFile::WriteFile
Fields
DefaultBlockSize
Default bytes per request (1 MB).
Syntax
static constexpr DWORD DefaultBlockSize = 1024 * 1024;DefaultBlocksInFlight
Default number of requests in flight.
Syntax
static constexpr std::size_t DefaultBlocksInFlight = 5;MaxBlocksInFlight
Upper bound blocksInFlight is clamped to.
Syntax
static constexpr std::size_t MaxBlocksInFlight = 64;blockSize
blocksInFlight
Requests in flight at the same time.
Syntax
std::size_t blocksInFlight = DefaultBlocksInFlight;Remarks
Clamped to 1..MaxBlocksInFlight.
startOffset
First byte read by AsyncFile::ReadFile.
Syntax
std::uint64_t startOffset = 0;Remarks
The memory gets the rest of the file; ignored by AsyncFile::WriteFile.
Generated from ThinkMeta.ConcurrentTasks.API @ 137ec1d (2026-10-17).