How can I find out where the runtime.futex is coming from? It only has "System" as its parent

works "go tool pprof" with cpu profile for and typing "web". I am getting svg profile using runtime.futex extensively, but I can't figure out where it comes from, it just says "System". I want to know what code my program is calling that is causing so much time to spend on runtime.futex.

profile screenshot

Of course, I passed in '-nodefraction = 0' which makes it not delete nodes in the web svg view, although it says "Showing 80 top nodes out of 246 (cum> = 0.11s)", it might be related.

I tried and it shows the same thing. Vis does not contain nodes or edges, but still runtime.futex only appears under System and that's the root node :?


source to share

1 answer

Futex or "Fast User Mutex Space" is a linux system call that is used for basic locking. I assume the runtime uses it quite a bit under the hood.

Not seeing some of the code, which is hard to say for sure, but for highly concurrent code with a lot of coordination using pipes, it is possible that the futex calls do indeed come from System and have no special functionality.



All Articles