Thanks Jan. type Y struct {
M string N string } func initalize() Y{ // I have a func that return an object ob type Y. } var obj1 Y = go initalize() var obj2 Y = go initalize() Let me know how to call a go routine in this case, because when I am doing it in this way I am getting compilation error. Thanks. On Mon, May 6, 2019 at 4:55 PM Jan Mercl <0xj...@gmail.com> wrote: > On Mon, May 6, 2019 at 1:11 PM Nitish Saboo <nitish.sabo...@gmail.com> > wrote: > > > > Hi, > > > > I want a go method to run on multiple cores.The go method is returning > an object. Can we achieve this using goroutine ? > > How can I achieve this ? > > In the first approximation, to run a a function/method f() in a > goroutine on N cores/threads, provided N is equal GOMAXPROCS, execute > `go f()` N times. > > Why do you care about "stick to core"? If the goroutines have work to > do, they will get spread by the scheduler between threads/cores > anyway. > -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.