Hi, Guilhem!
On Jun 08, Guilhem Bichot wrote:
> Marc Alff a écrit, Le 07.06.2009 20:17:
>> #At file:///home/malff/BZR-TREE/mysql-6.0-perfschema/ based on
>> revid:marc.alff@stripped
>> 3167 Marc Alff 2009-06-07
>> Cleanup of PFS_atomic
...
> As you have seen, Serg and I recommend using my_atomic_rwlock_t instead of
> pthread_mutex_t, because my_atomic_rwlock_t has been designed precisely for
> cases where atomic ops are not implemented.
>
> Now, if we changed the plain unmodified pthread_mutex_t above to
> my_atomic_rwlock_t, we would reintroduce the problem because
> if SAFE_MUTEX is defined, my_atomic_rwlock_t is safe_mutex_t.
> There are solutions:
> 1) we can make my_atomic_rwlock_t always be a plain unmodified POSIX
> pthread_mutex_t.
> 2) or we can make safe_mutex never generate any events; this one is more
> complicated because it uses my_malloc() and my_hash_insert() (if doing
> deadlock detection). We could disable deadlock detection for
> THR_LOCK_malloc; we could also not instrument THR_LOCK_malloc, which is a
> Serg's idea, where we would not instrument debug-specific objects so that
> the execution flow of the debug binary is closer to the one of the release
> binary. We could also turn off instrumentation for the thread when entering
> safe_mutex_lock() and turn it on again when leaving the function.
>
> Don't change your code to use my_atomic_rwlock_t for now, let's first see
> what Serg, who authored my_atomic_rwlock_t, would recommend.
Both suggestions make sense and both could be done.
The first one is simpler, it'll solve the immediate problem, so let's do
it.
But the second one is good as it helps to avoid profile distortion
caused by compiled-in debugging code. But it's not an urgent problem at
the moment.
Conclusion: solution #1.
Regards / Mit vielen Grüßen,
Sergei
--
__ ___ ___ ____ __
/ |/ /_ __/ __/ __ \/ / Sergei Golubchik <serg@stripped>
/ /|_/ / // /\ \/ /_/ / /__ Principal Software Engineer/Server Architect
/_/ /_/\_, /___/\___\_\___/ Sun Microsystems GmbH, HRB München 161028
<___/ Sonnenallee 1, 85551 Kirchheim-Heimstetten
Geschäftsführer: Thomas Schroeder, Wolfgang Engels, Wolf Frenkel
Vorsitzender des Aufsichtsrates: Martin Häring