[Mesa-dev] [PATCH] mesa: avoid pthread_mutexes when adjusting object refcounts

Matt Turner mattst88 at gmail.com
Wed Oct 19 22:22:27 UTC 2016


On Wed, Oct 19, 2016 at 1:58 PM, Jan Ziak <0xe2.0x9a.0x9b at gmail.com> wrote:
> The current git code and the patched code are fully equivalent to each
> other. In the unpatched code RefCount is always protected by a mutex
> and the RefCount adjustment region protects just the RefCount (it
> doesn't protect anything else) - in the patched code RefCount is
> always adjusted via p_atomic*().
>
> Because of this equivalence: If the new code contains a bug then the
> unpatched code must contain the same bug as well.

That's all well and good, but it's not sufficient and not really how
we do things. To replace the mutexes around bufferobjs and texobjs
with atomics would take us *further* from working code.

I see that your v2 removes the changes to shaderobj.c, but I don't
know why. It doesn't look like I made changes to it in my series
either.


More information about the mesa-dev mailing list