I have a C++ program that calls Go exported functions from ~20 OS threads created and managed by C++. When I am calling those exported Go functions a few millions a second, I noticed that the overheads of runtime.needm/runtime.dropm becomes a bottleneck. The docs made it pretty clear why needm/dropm is required. To workaround it, I had to steal some Go created threads by first using CGO to call some C functions from Go, then I used those threads to call exported Go functions. By doing that, they are now actual callbacks and no longer suffer from the needm/dropm overheads.
My concern is that the above approach looks more like a hack to me. Is there a better way to do the same? Thanks! Lei -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.