Zig 0.17.0-dev (Split by item)

Shortcut keys
?
Show these tips
S
Focus search field
Esc
Clear focus & close tips
U
Jump to source code
↑
Move up in search results
↓
Move down in search results
↵
Go to active search result
This is an example of documentation generated by ZigDoc, an alternative to Zig's built-in Auto Doc feature. See also examples in other modes/formats. The project being documented here (as the example) is the Zig standard library. Public Struct

InitOptions

Public Struct
std.Io.Threaded.InitOptions
pub const InitOptions = struct

Fields

stack_size: usize = std.Thread.SpawnConfig.default_stack_size

Affects how many bytes are memory-mapped for threads.

async_limit: ?Io.Limit = null

Maximum thread pool size (excluding main thread) when dispatching async tasks. Until this limit, calls to Io.async when all threads are busy will cause a new thread to be spawned and permanently added to the pool. After this limit, calls to Io.async when all threads are busy run the task immediately.

Defaults to one less than the number of logical CPU cores.

Protected by Threaded.mutex once the I/O instance is already in use. See setAsyncLimit.

concurrent_limit: Io.Limit = .unlimited

Maximum thread pool size (excluding main thread) for dispatching concurrent tasks. Until this limit, calls to Io.concurrent will increase the thread pool size.

After this number, calls to Io.concurrent return error.ConcurrencyUnavailable.

argv0: Argv0 = .empty

Affects the following operations:

environ: process.Environ = .empty

Affects the following operations:

disable_memory_mapping: bool = false

If set to true, File.MemoryMap APIs will always take the fallback path.

File

Io/Threaded.zig:1575
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
pub const InitOptions = struct {
    /// Affects how many bytes are memory-mapped for threads.
    stack_size: usize = std.Thread.SpawnConfig.default_stack_size,
    /// Maximum thread pool size (excluding main thread) when dispatching async
    /// tasks. Until this limit, calls to `Io.async` when all threads are busy will
    /// cause a new thread to be spawned and permanently added to the pool. After
    /// this limit, calls to `Io.async` when all threads are busy run the task
    /// immediately.
    ///
    /// Defaults to one less than the number of logical CPU cores.
    ///
    /// Protected by `Threaded.mutex` once the I/O instance is already in use. See
    /// `setAsyncLimit`.
    async_limit: ?Io.Limit = null,
    /// Maximum thread pool size (excluding main thread) for dispatching concurrent
    /// tasks. Until this limit, calls to `Io.concurrent` will increase the thread
    /// pool size.
    ///
    /// After this number, calls to `Io.concurrent` return `error.ConcurrencyUnavailable`.
    concurrent_limit: Io.Limit = .unlimited,
    /// Affects the following operations:
    /// * `processExecutablePath` on OpenBSD and Haiku.
    argv0: Argv0 = .empty,
    /// Affects the following operations:
    /// * `fileIsTty`
    /// * `processExecutablePath` on OpenBSD and Haiku (observes "PATH").
    /// * `processSpawn`, `processSpawnPath`, `processReplace`, `processReplacePath`
    environ: process.Environ = .empty,
    /// If set to `true`, `File.MemoryMap` APIs will always take the fallback path.
    disable_memory_mapping: bool = false,
}