On Fri, Nov 30, 2018 at 12:44 PM Alex Dvoretskiy
<advoretski...@gmail.com> 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 don't need any synchronization between the three. You might use a
sync.WaitGroup to wait for all of them to end.
>
> https://play.golang.org/p/n-QLR7V0H49
>
> --
> 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.

-- 
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.

Reply via email to