Mojo function
parallelize
parallelize[func: fn(Int) capturing -> None](num_work_items: Int)
Executes func(0) ... func(num_work_items-1) as sub-tasks in parallel, and returns when all are complete.
Parameters:
- func (
fn(Int) capturing -> None
): The function to invoke.
Args:
- num_work_items (
Int
): Number of parallel tasks.
parallelize[func: fn(Int) capturing -> None](num_work_items: Int, num_workers: Int)
Executes func(0) ... func(num_work_items-1) as sub-tasks in parallel, and returns when all are complete.
Parameters:
- func (
fn(Int) capturing -> None
): The function to invoke.
Args:
- num_work_items (
Int
): Number of parallel tasks. - num_workers (
Int
): The number of workers to use for execution.
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!