On Tue, Sep 10, 2024 at 6:54 AM 'Karolina GORNA' via golang-nuts <golang-nuts@googlegroups.com> wrote: > > Maybe the question has already been asked, but I would be glad to have your > feedback. > > Can a golang program be compiled to run with only one goroutine, or at least > one "OS thread" ? > > I am aware of using GOMAXPROCS(1) to have only one "OS thread" or to use > taskset -c 1 go build . to force having one "OS thread". These commands don't > really work in practice, since with trace execution tools, I can see that > many threads are used during the execution at the end.
For the standard Go implementation, no, this is not possible. Go is inherently multi-threaded. 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. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/CAOyqgcVqq%3DyBofB8J5gr1oQFLbMdb-__LK8jdnzhKx3zDP4wGg%40mail.gmail.com.