Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func TimeLoopArgs ¶
Types ¶
type TaskPool ¶
type TaskPool struct {
// contains filtered or unexported fields
}
================================================================ 多个线程,一个任务队列,多个线程竞争从队列中获取任务并执行
func NewTaskPool ¶
type Thread ¶
type Thread struct {
// contains filtered or unexported fields
}
=====================================================================
type ThreadPool ¶
type ThreadPool struct {
// contains filtered or unexported fields
}
开启多个线程,每个线程都有一个独立的任务队列,所有队列并行执行
func NewThreadPool ¶
func NewThreadPool(poolSize, threadWorkSize int) *ThreadPool
func (*ThreadPool) Start ¶
func (d *ThreadPool) Start()
func (*ThreadPool) Stop ¶
func (d *ThreadPool) Stop()
func (*ThreadPool) Submit ¶
func (d *ThreadPool) Submit(threadId int, task *Task)
Click to show internal directories.
Click to hide internal directories.