Documentation
¶
Overview ¶
Package parallel provides concurrency utilities for parallel data processing.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ParallelForEach ¶
ParallelForEach applies a function to each element in parallel (no return value).
func ParallelMap ¶
ParallelMap applies a function to each element in parallel and returns results.
func ParallelReduce ¶
func ParallelReduce[T, R any](data []T, fn func(T, R) R, initial R, combiner func(R, R) R, workers int) R
ParallelReduce reduces data using a function in parallel.
Types ¶
type Pool ¶
type Pool struct {
// contains filtered or unexported fields
}
Pool represents a worker pool for parallel task execution.
func NewPool ¶
NewPool creates a new worker pool with the specified number of workers. If workers <= 0, it defaults to runtime.NumCPU().
Click to show internal directories.
Click to hide internal directories.