MySQL Forums
Forum List  »  InnoDB

Re: What's the difference between concepts--latch and mutex?
Posted by: feng guo
Date: May 29, 2014 11:15PM

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~

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: What's the difference between concepts--latch and mutex?
1867
May 29, 2014 11:15PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.