[go-nuts] Re: Can a golang program be compiled to run with only ONE goroutine ?

2024-09-10 Thread Zxilly Chou
If you compile it to WebAssembly, it will works under the single thread model. However, there are still multi *goroutine *be created, it was designed to. 在2024年9月10日星期二 UTC+8 21:54:56 写道: > Hello, > > Maybe the question has already been asked, but I would be glad to have > your feedback. > >

Re: [go-nuts] Can a golang program be compiled to run with only ONE goroutine ?

2024-09-10 Thread Ian Lance Taylor
On Tue, Sep 10, 2024 at 6:54 AM 'Karolina GORNA' via golang-nuts 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 GOMAXPR

[go-nuts] Re: Can a golang program be compiled to run with only ONE goroutine ?

2024-09-10 Thread 'Brian Candler' via golang-nuts
What's your use case? Would TinyGo be sufficient for your needs? https://tinygo.org/docs/guides/tips-n-tricks/ "TinyGo code runs on a single core, in a single thread (think GOMAXPROCS=1)" On Tuesday 10 September 2024 at 14:54:56 UTC+1 Karolina GORNA wrote: > Hello, > > Maybe the question has alr

[go-nuts] Can a golang program be compiled to run with only ONE goroutine ?

2024-09-10 Thread 'Karolina GORNA' via golang-nuts
Hello, 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 fo