Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/orestonce/gopool

go线程池
https://github.com/orestonce/gopool

Last synced: 23 days ago
JSON representation

go线程池

Awesome Lists containing this project

README

        

# go线程池使用方法

````go
package main

import (
"fmt"
"github.com/orestonce/gopool"
)

func main() {
task := gopool.NewThreadPool(10) // 最大线程数
task.AddJob(func() {
fmt.Println("thread1")
})
task.AddJob(func() {
fmt.Println("thread2")
})
task.CloseAndWait()
}
````