maria-developers team mailing list archive
Mailing list archive
Re: 8a0f331: MDEV-7943 - pthread_getspecific() takes 0.76% in OLTP RO
On Wed, May 13, 2015 at 05:25:21PM +0200, Sergei Golubchik wrote:
> Hi, Sergey!
> On May 13, Sergey Vojtovich wrote:
> > > >
> > > > - while (is_on() && !thd_killed(NULL))
> > > > + while (is_on() && !thd_killed(current_thd))
> > >
> > > thd_killed() is a function of the kill_statement service
> > > (see include/mysql/service_kill_statement.h). It is created for plugins
> > > to use. But current_thd is not. Plugins generally have no access to it.
> > Speaking of general sanity: there's no other code that does thd_killed(NULL).
> > Speaking of semisync plugin sanity: it does lots of direct server function calls
> > already, including current_thd.
> > Do you think it is worth to preserve this thd_killed(NULL)?
> > I believe it is quite easy to extend replication plugin interface so that THD
> > is passed through. But is it worth it?
> There's no need to change semisync plugin, if it uses current_thd, then
> it can also use it for thd_killed().
> But if you'll require thd_killed() always to take THD as an argument,
> then other plugins (that work strictly within plugin api limits)
> won't be able to check killed flag in places where THD isn't available.
> May be it's not a problem, though, I don't know.
I can suggest 3 alternatives:
- add thd_killed_current() (now or on demand?)
- add current_thd() to API (now or on demand?)
- keep if (!thd), even though it makes mostly useless branch per row
Which one do you like most?