workerpool

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 16, 2026 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Package workerpool provides a persistent pool of goroutines that process submitted tasks. It replaces per-call goroutine spawning in GEMV and element-wise operations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Pool

type Pool struct {
	// contains filtered or unexported fields
}

Pool is a fixed-size pool of long-lived worker goroutines.

func New

func New(n int) *Pool

New creates a pool with n worker goroutines that block on a shared task channel.

func (*Pool) Close

func (p *Pool) Close()

Close shuts down the pool. It is safe to call multiple times.

func (*Pool) Submit

func (p *Pool) Submit(tasks []func())

Submit sends all tasks to the pool and blocks until every task completes.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL