Always have x number of goroutines running at any time
问题 I see lots of tutorials and examples on how to make Go wait for x number of goroutines to finish, but what I'm trying to do is have ensure there are always x number running, so a new goroutine is launched as soon as one ends. Specifically I have a few hundred thousand 'things to do' which is processing some stuff that is coming out of MySQL. So it works like this: db, err := sql.Open("mysql", connection_string) checkErr(err) defer db.Close() rows,err := db.Query(`SELECT id FROM table`)