Cgo. When i call to go functions from c process . When and how the go runtime started. What if i have 2 go project compiled into shared object and wrapped by cgo , is go runtime will run twice?
Why cgo must to have func main?
I created test that one c main call to 2 different go shared object
Each go shared object have wrapped by cgo
When i run the cgo SO were conflict and crash
Only when i dedicate c thread to each SO the conflict and crash stop
Alternatively i wrapped the 2 So with one common cgo
It it work good
I wonder ,when go runtime start in this flow?
Is it run twice on the main thread?
Yuval Abadi is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.