Hello,

> I find it is tricky to debug a concurrency Go program in multi-core
> systems, so I wonder if there is a way to make the program run in
> deterministically. Can I assume a program with GOMAXPROCS(1) can be 
> deterministically
> executed ?

Even with GOMAXPROCS=1, a Go program is not 100% deterministic. See this
funny blog post on how to gain randomness even without using the standard
library.
https://blog.merovius.de/2018/01/15/generating_entropy_without_imports_in_go.html

Using libs, there are even more sources of indeterminism, e.g. time.Now()
or both of the "rand" packages.

Best regards,
Harald

-- 
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/20201102073052.GA12615%40hweidner.de.

Reply via email to