← Back to team overview

maria-developers team mailing list archive

Re: MariaDB mutex contention

 

Hi, Pavel!

On Aug 19, Pavel Ivanov wrote:
> No, it's not reasonable for semi-sync to lock/unlock LOCK_plugin. It's
> plugin infrastructure that does that.
> 
> I've actually was terrified to learn that each call into semi-sync
> plugin is surrounded with pthread_rwlock_rdlock/pthread_rwlock_unlock
> (which is not cheap I believe). And also for each such call it
> "locks"/"unlocks" the semi-sync plugin. And although "locking" plugin
> avoids locking LOCK_plugin when plugin is linked statically,
> "unlocking" doesn't do that.

Unlocking does that too, it's completely symmetrical.
See plugin_unlock() function, it starts from

  /* built-in plugins don't need ref counting */
  if (!plugin_dlib(plugin))
      DBUG_VOID_RETURN;

Regards,
Sergei


Follow ups

References