On Sat, Jun 18, 2016 at 10:17 PM, Manohar Kumar <forwarding...@gmail.com> wrote: > > Is it possible that a net.ListenTCP or ListenUDP call can result in new go > routine/OS thread creation ? I guess not all system calls result in a new go > routine (and OS thread if necessary) creation. But ListenTCP & UDP does many > things underneath and its not clear if it can lead to new go routine > creation.
ListenTCP and ListenUDP will not create new goroutines or threads. But those calls just create new listeners; you probably meant to ask about the AcceptTCP and ReadFrom/WriteTo methods. Those methods will not normally create new goroutines. However, they may block, and that may cause the Go runtime to create a new thread. > I am mainly interested in Linux and have to make these calls in a part of > the code where new OS thread creation isn't desirable. Please note that > changing that aspect of the design itself is not an option for me. The Go runtime is free to create new OS threads at any time. You can not reasonably use Go under the restrictions you describe. Ian -- 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.