December 17, 2021 10:33 PM, "Henri Verbeet" hverbeet@gmail.com wrote:
If the issue is that the application copies small numbers of descriptors each time, that should be easy to detect. We could use the current path with individual locks for each descriptor in that case. I'm not sure whether it's worth doing that or not though; for applications copying large numbers of descriptors like Control, always using a single mutex is likely the more efficient option.
I think it's not worth it at the moment. We would lock 8 descriptors at once for games which don't need atomic descriptors, but not for the only game which does. If performance becomes a problem in the future for the single mutex we can add a spinlock to each descriptor at a cost of 4 bytes per descriptor.