parallel

package
v0.4.15 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BatchParallel

func BatchParallel(nJobs, nWorkers, batchSize int, worker func(workerId, beginJobId, endJobId int) error) error

BatchParallel run parallel jobs in batches to reduce the cost of context switch.

func DynamicParallel added in v0.4.6

func DynamicParallel(nJobs int, jobsAlloc *task.JobsAllocator, worker func(workerId, jobId int) error) error

func Parallel

func Parallel(nJobs, nWorkers int, worker func(workerId, jobId int) error) error

Parallel schedules and runs tasks in parallel. nTask is the number of tasks. nJob is the number of executors. worker is the executed function which passed a range of task Names (begin, end).

Types

type ConditionChannel added in v0.4.9

type ConditionChannel struct {
	C chan struct{} // output channel
	// contains filtered or unexported fields
}

func NewConditionChannel added in v0.4.9

func NewConditionChannel() *ConditionChannel

func (*ConditionChannel) Close added in v0.4.9

func (c *ConditionChannel) Close()

func (*ConditionChannel) Signal added in v0.4.9

func (c *ConditionChannel) Signal()

Jump to

Keyboard shortcuts

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