3 ms·
> Contrary to what the author supposed about the performance, the fast Go version can't even be run over multiple threads. Since go deliberately fully hides th
by jsmith45 4y ago
> Contrary to what the author supposed about the performance, the fast Go version can't even be run over multiple threads.
Since go deliberately fully hides the os threads, this TLS emulation would be per green thread (per go-routine).
I don't see why the go code could not spin up say N goroutines, each one with one NewBatch() call to initialize the simulated TLS for that green thread, followed by repeatedly calling XgeoToH3() (which should be cleaning up its TLS usage to be back to 0 bytes used upon return).
Needing to call NewBatch one per thread changes the API a little from the cgo API, but I don't think it is otherwise not thread safe.