Re: [go-nuts] recursion plus goroutines

2018-11-30 Thread Alex Dvoretskiy
Yes! This is perfect! On Friday, November 30, 2018 at 2:52:57 PM UTC-8, Justin Israel wrote: > > > > On Sat, Dec 1, 2018, 10:43 AM Alex Dvoretskiy > wrote: > >> Here is recursion. I d'ont know when its end. >> > > Do you mean that you want to wait for all 3 goroutines to complete? > > var wg syn

Re: [go-nuts] recursion plus goroutines

2018-11-30 Thread Justin Israel
On Sat, Dec 1, 2018, 10:43 AM Alex Dvoretskiy wrote: > Here is recursion. I d'ont know when its end. > Do you mean that you want to wait for all 3 goroutines to complete? var wg sync.WaitGroup wg.Add(3) go func() { inOrderTr(root) wg.Done() }() go func() { preOrderTr(root) wg.

Re: [go-nuts] recursion plus goroutines

2018-11-30 Thread Alex Dvoretskiy
Here is recursion. I d'ont know when its end. On Friday, November 30, 2018 at 12:04:42 PM UTC-8, Burak Serdar wrote: > > On Fri, Nov 30, 2018 at 12:44 PM Alex Dvoretskiy > > wrote: > > > > Hi, > > > > How should I modify my code if I want to run three recursive functions > in parallel? > >

Re: [go-nuts] recursion plus goroutines

2018-11-30 Thread Burak Serdar
On Fri, Nov 30, 2018 at 12:44 PM Alex Dvoretskiy wrote: > > Hi, > > How should I modify my code if I want to run three recursive functions in > parallel? > > go inOrderTr(root) > go preOrderTr(root) > go postOrderTr(root) Those three are mutually independent, and the tree is read-only, so you do

[go-nuts] recursion plus goroutines

2018-11-30 Thread Alex Dvoretskiy
Hi, How should I modify my code if I want to run three recursive functions in parallel? go inOrderTr(root) go preOrderTr(root) go postOrderTr(root) https://play.golang.org/p/n-QLR7V0H49 -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsub