6 ms·
> I have wrapped a large C++ library for Go How well does it work the other way round - calling Go from C/C++? IIRC when I first looked into doing that, it was
by pansa2 6y ago
> I have wrapped a large C++ library for Go
How well does it work the other way round - calling Go from C/C++? IIRC when I first looked into doing that, it wasn’t really possible - only threads that were started by Go could run Go code. In particular, `main` had to be in Go and couldn’t be in C++. Does that restriction still apply?
- _ph_ 6y agoI have created shared libraries with Go which can be called from C, no problems. Those shared libraries can start their own goroutines quite fine and can call back into the C application. Usually it is a good idea to call back into the C application from the thread the Go function called from C was running.