Switch to go and channels. You won’t have to worry about locking any more, the design of your program becomes a data flow design issue. (Speaking as a former C programmer). Hardware takes so long to change but more atomicity would be great, but 8n the meantime go runtime is fast, generally lock less to the per request application code flow, and you use all the cores evenly.