Solution: as libzmq already provides this across all platforms, expose an atomic counter API. I've not wrapped atomic pointers, though someone who needs this may want to do so.