~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/drizzled.cc

  • Committer: Brian Aker
  • Date: 2009-01-24 13:22:10 UTC
  • Revision ID: brian@gir-3.local-20090124132210-kdoac6t6ztyp3crc
Move number of threads to use for pool of threads to module. Removed slave
thrad cheats from session object.

Show diffs side-by-side

added added

removed removed

Lines of Context:
312
312
uint64_t slow_launch_time;
313
313
uint64_t slave_open_temp_tables;
314
314
uint64_t open_files_limit;
315
 
uint64_t thread_pool_size= 0;
316
315
uint32_t refresh_version;  /* Increments on each reload */
317
316
uint64_t aborted_threads;
318
317
uint64_t aborted_connects;
412
411
 
413
412
pthread_key_t THR_Mem_root;
414
413
pthread_key_t THR_Session;
415
 
pthread_mutex_t LOCK_drizzle_create_db, LOCK_open, LOCK_thread_count,
 
414
pthread_mutex_t LOCK_drizzle_create_db, 
 
415
                LOCK_open, 
 
416
                LOCK_thread_count,
416
417
                LOCK_status,
417
418
                LOCK_global_read_lock,
418
419
                LOCK_global_system_variables,
557
558
  I_List_iterator<Session> it(threads);
558
559
  while ((tmp=it++))
559
560
  {
560
 
    /* We skip slave threads & scheduler on this first loop through. */
561
 
    if (tmp->slave_thread)
562
 
      continue;
563
 
 
564
561
    tmp->killed= Session::KILL_CONNECTION;
565
562
    thread_scheduler.post_kill_notification(tmp);
566
563
    if (tmp->mysys_var)
1573
1570
          tmp_sched_param.sched_priority= INTERRUPT_PRIOR;
1574
1571
          (void)pthread_attr_setschedparam(&connection_attrib, &tmp_sched_param);
1575
1572
        }
1576
 
        if (pthread_create(&tmp,&connection_attrib, kill_server_thread,
1577
 
                           (void*) &sig))
1578
 
              errmsg_printf(ERRMSG_LVL_ERROR, _("Can't create thread to kill server"));
 
1573
        if (pthread_create(&tmp,&connection_attrib, kill_server_thread,
 
1574
                           (void*) &sig))
 
1575
          errmsg_printf(ERRMSG_LVL_ERROR, _("Can't create thread to kill server"));
1579
1576
#else
1580
 
        kill_server((void*) sig);       // MIT THREAD has a alarm thread
 
1577
        kill_server((void*) sig);       // MIT THREAD has a alarm thread
1581
1578
#endif
1582
1579
      }
1583
1580
      break;
3144
3141
      "error. Used only if the connection has active cursors."),
3145
3142
   (char**) &table_lock_wait_timeout, (char**) &table_lock_wait_timeout,
3146
3143
   0, GET_ULL, REQUIRED_ARG, 50, 1, 1024 * 1024 * 1024, 0, 1, 0},
3147
 
  {"thread_pool_size", OPT_THREAD_CACHE_SIZE,
3148
 
    N_("How many threads we should create to handle query requests in case of "
3149
 
       "'thread_handling=pool-of-threads'"),
3150
 
    (char**) &thread_pool_size, (char**) &thread_pool_size, 0, GET_ULL,
3151
 
    REQUIRED_ARG, 8, 1, 16384, 0, 1, 0},
3152
3144
  {"thread_stack", OPT_THREAD_STACK,
3153
3145
   N_("The stack size for each thread."),
3154
3146
   (char**) &my_thread_stack_size,