List:Internals« Previous MessageNext Message »
From:Konstantin Osipov Date:March 23 2010 6:59pm
Subject:Re: Is that intentional or my configure error?
View as plain text  
* Tianwei <tianwei.sheng@stripped> [10/03/23 17:39]:
> 
> 3. if the above is true, then how we can understand the following
> comments as it assumes that data_file_length is protected by the same
> strucutre_guard_mutex: sql/ha_myisam.cc
> +  /*
> +    POSIX visibility rules specify that "2. Whatever memory values a
> +    thread can see when it unlocks a mutex <...> can also be seen by any
> +    thread that later locks the same mutex". In this particular case,
> +    concurrent insert thread had modified the data_file_length in
> +    MYISAM_SHARE before it has unlocked (or even locked)
> +    structure_guard_mutex. So, here we're guaranteed to see at least that
> +    value after we've locked the same mutex. We can see a later value
> +    (modified by some other thread) though, but it's ok, as we only want
> +    to know if the variable was changed, the actual new value doesn't matter
> +  */

This comment explains a hack that is used in the query cache: 

we don't take the mutex that protects the myisam share, but
by taking a different mutex ensure some level of memory coherency,
sufficient for the task.

-- 
Thread
Is that intentional or my configure error?Tianwei23 Mar
  • Re: Is that intentional or my configure error?xiaobing jiang23 Mar
    • Re: Is that intentional or my configure error?Tianwei23 Mar
  • Re: Is that intentional or my configure error?Sergey Vojtovich23 Mar
    • Re: Is that intentional or my configure error?Tianwei23 Mar
      • Re: Is that intentional or my configure error?Tianwei23 Mar
        • Re: Is that intentional or my configure error?Sergey Vojtovich23 Mar
        • Re: Is that intentional or my configure error?Konstantin Osipov23 Mar
Re: Is that intentional or my configure error?Tianwei24 Mar