List:Commits« Previous MessageNext Message »
From:Paul DuBois Date:April 20 2011 5:31pm
Subject:Re: Bug#11764633 commit review
View as plain text  
On Apr 20, 2011, at 12:13 PM, Sergei Golubchik wrote:

> Hi, Georgi!
> 
> On Apr 20, Georgi Kodinov wrote:
>> You're on the right track about this bug
>> (http://lists.mysql.com/commits/135162), but it needs some more
>> cleanup: 
>> 
>> IMHO you shouldn't use my_thread_var. The embedded server code creates
>> just 1 thread structure (THD) per connection. Whenever some arbitrary
>> thread executes something on a connection emb_advanced_command() sets
>> the thread key for the THD to the structure used and updates the THD
>> and my_thread_var for the current thread so that they point to each
>> other, thus effectively switching the actual thread to the THD.
>> Unfortunately once done, emb_advanced_command() doesn't switch out of
>> the association completely: it only resets THD::mysys_var and never
>> does anything for my_thread_var and for the rest of the thread
>> specific keys (THD_THD and THD_MALLOC).
> 
> You are saying here, basically, that a THD in the embedded server cannot
> be used by different threads (not concurrently, sequentially - first in
> one thread, then in another).
> 
> You are right, but I think this limitation is independent from the bug
> in question. That is, it does not necessarily have to be fixed in this
> bug fix.
> 
> But anyway, if you will want to fix it together with this bug, please
> make sure that there are tests for this new feature - THD migration
> between threads. And that it's clearly mentioned in the changeset
> comment, so that Paul prominently documents it in the manual.

What relevance would this have for the manual? That is, why would users
be affected by it or even care?  Seems more like an Internals thing,
or am I missing something?

-- 
Paul DuBois
Oracle Corporation / MySQL Documentation Team
Madison, Wisconsin, USA
www.mysql.com

Thread
Re: Bug#11764633 commit reviewSergei Golubchik20 Apr
  • Re: Bug#11764633 commit reviewPaul DuBois20 Apr
    • Re: Bug#11764633 commit reviewSergei Golubchik20 Apr
Re: Bug#11764633 commit reviewSergei Golubchik21 Apr