Mysql原始碼分析2

dongyu2013發表於2014-03-26
get_options()出現在init_common_variables中
Get server options from the command line, and perform related server initializations.
struct system_variables global_system_variables;
struct system_variables max_system_variables;
system_variables 解釋如下
 How dynamically allocated system variables are handled:
 The global_system_variables and max_system_variables are "authoritative"
 They both should have the same 'version' and 'size'.
 When attempting to access a dynamic variable, if the session version
 is out of date, then the session version is updated and realloced if
 neccessary and bytes copied from global to make up for missing data.
mysqld.cc 處理多執行緒還是單執行緒 在get_options中
  if (thread_handling <= SCHEDULER_ONE_THREAD_PER_CONNECTION)
    one_thread_per_connection_scheduler();    ------》呼叫handle_one_connection
  else    /* thread_handling == SCHEDULER_NO_THREADS) */
    one_thread_scheduler();



來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/29012686/viewspace-1130271/,如需轉載,請註明出處,否則將追究法律責任。

相關文章