Go routine after a total of exactly 20 numbers
Hi. How much work does each go routine do? Twenty routines printing one number each? 100 routines but stop after 20 numbers are written?
You could have a counter which all go routines increment and a mutex which the go routines locks and unlocks then they increments it and if the counter is 20 should the go routine jus return