8000 GitHub - rdarder/goworkers: Distribute goroutines into different threads · GitHub
[go: up one dir, main page]

Skip to content
8000
rdarderPublic

About

Distribute goroutines into different threads

Resources

Stars

7 stars

Watchers

1 watching

Forks

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 

Repository files navigation

PACKAGE

package workers
    import "workers"

    The workers package allows launching a function as many goroutines and
    keeping those in separate threads. Given a CPU intensive worker like
    function it would be good to have many workers concurrently processing
    without having each other competing for the same resources. Basically,
    having one worker goroutine per CPU and each goroutine in a separate
    thread would do it.

FUNCTIONS

func Distribute(num_threads int, wg *sync.WaitG
4EAC
roup, worker func())
    Distribute worker into `num_threads` goroutines in separate threads. All
    new goroutines will belong to a the waitgroup

func Fill(worker func()) *sync.WaitGroup
    Fill will spawn as many worker goroutines as GOMAXPROCS and keep them in
    different threads


About

Distribute goroutines into different threads

Resources

Stars

7 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages

0