Rick James Wrote:
-------------------------------------------------------
>
http://en.wikipedia.org/wiki/Latch
>
http://en.wikipedia.org/wiki/Mutex
>
> Mutex is often mentioned in MySQL; Latch is not.
>
> A Mutex is a mechanism whereby two pieces of code
> can keep from stepping on each other's toes.
> Example: When a mysql thread needs to allocate
> something shared, such as a cache entry, it will
> "acquire" a mutex, do its thing, then release the
> mutex. In that brief time when it "owns" the
> mutex, other threads cannot get the mutex, hence
> may be delayed in what they are doing.
>
> Recently (Percona XtraDB, Oracle's 5.6, etc) the
> Mutex code has been cleaned up. There used to be
> only a "few" mutexes, and multi-CPU machines were
> unable to take much advantage of having multiple
> CPUs. Now, the mutexes are less "global" and more
> fine-grained and are held less long. This allows
> MySQL to have better concurrency beyond 8 cores.
Thanks for your answer~