Sets the minimum number of bytes to process before enqueueing a handler block.


void dispatch_io_set_low_water(dispatch_io_t channel, size_t low_water);



The channel whose low-water mark you want to configure.


The minimum number of bytes to read or write before enqueueing the corresponding I/O handler block.


During a read or write operation, the channel uses the high- and low-water mark values to determine how often to enqueue the associated handler block. It enqueues the block when the number of bytes read or written is between these two values. The only times when the number of bytes may be less than the low-water mark are when an EOF is reached or the channel interval has the DISPATCH_IO_STRICT_INTERVAL flag set.

In practice, your handlers should be designed to handle data blocks that are significantly larger than the current low-water mark. If you always want to process the same amount of data in your handler, set the low- and high-water marks to the same value.

The default low-water mark for channels is unspecified. However, you should assume that partial results can be returned even with this default value. If you want to prevent the return of partial results, set the low-water mark to SIZE_MAX.

See Also

Managing the File Descriptor


Returns the file descriptor associated with the specified channel.


Sets the interval (in nanoseconds) at which to invoke the I/O handlers for the channel.


The type for flags used to specify the dispatch interval of a channel.


Sets the maximum number of bytes to process before enqueueing a handler block.