|
|
|
|
|
by alecthomas
1123 days ago
|
|
ChatGPT's responses start accurate then quickly go off the rails. The section from this point onwards is completely incorrect: > Say I called a bunch of goroutines when I was in the Add function of the example you gave, would this be a problem? The Go runtime is initialised once only in c-shared mode for the lifetime of the application - it would make no sense to do it on every function invocation, and be incredibly slow. So the answer to this section and the next one are just largely bogus. ie. this response > However, once you call a function via a C or Swift bridge, it becomes a synchronous operation and will block the calling thread until all goroutines have completed execution. Therefore, you would need to effectively manage the synchronization of these goroutines to avoid unnecessary blocking of the calling thread. And the response to this question: > You said in 4 the Go runtime may not keep running, does this mean that every invocation of the Add function has to spin up the whole Go runtime every time? Why cant it just stay alive inside the Swift process? Are completely incorrect. |
|