utils

package
v0.0.0-...-642adbf Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2015 License: MIT Imports: 0 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LimitTaskManager

type LimitTaskManager struct {
	RequireChan chan bool
	DoChan      chan bool
	FinishChan  chan bool

	MaxThreadNumber,
	TotalTaskCount int

	ActiveCount,
	WaitingCount,
	FinishedCount int

	AllTaskFinishedChan chan bool
}

func NewLimitTaskManager

func NewLimitTaskManager(maxThreadNumber, totalTaskCount int) *LimitTaskManager

type SafeList

type SafeList []interface{}

type UnlimitTaskManager

type UnlimitTaskManager struct {
	DemandChan         chan struct{} //要求进行任务
	DoChan             chan bool     //若为false, 所有任务完成
	TaskFinishesChan   chan struct{} //汇报任务完成
	AllTasksFinishChan chan struct{} //汇报所有任务完成

	IsAllTasksFinished bool

	MaxThreadNumber int

	ActiveCount,
	WaitingCount int

	WaitForFinishChan chan struct{} //阻塞直至所有任务完成
}

func NewUnlimitTaskManager

func NewUnlimitTaskManager(maxThreadNumber int) *UnlimitTaskManager

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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