4 ms·
> Calling Go code from a second thread will currently cause the code to raise an exception (i.e. all calls into Go code must be made from the same thread) That
by tiredofcareer 14y ago
> Calling Go code from a second thread will currently cause the code to raise an exception (i.e. all calls into Go code must be made from the same thread)
That's ... interesting.
- georgemcbay 14y agoI haven't looked at this much (not much of a Python user these days) but presumably you can still multithread your Go code using Go semantics regardless of this restriction. The Go code you call from Python should be able to create goroutines as needed which then report back to the main Go thread as needed, as long as they follow the Go conventions about pointer ownership (channel receiver owns the memory sent to it). Of course it would be nicer if the main Go thread didn't lock out the Python caller from running (which it seems to do), but there should still be lots of concurrency available on the Go side.