By default, when the main Goroutine completes, all other _____ are terminated.

  • Goroutines
  • Threads
  • Processes
  • Channels
By default, when the main Goroutine (the one that starts when the Go program is executed) completes its execution, all other Goroutines in the program are terminated. This behavior ensures that the program doesn't exit until all Goroutines have finished their tasks. However, you can use synchronization mechanisms like channels to wait for other Goroutines to complete before allowing the program to exit.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *