Skip to content
  • Jon Olav Hauglid's avatar
    6d0e6b99
    WL#7260: Split LOCK_thread_count · 6d0e6b99
    Jon Olav Hauglid authored
    After the improvements made in WL#6606, performance testing has
    shown that the major bottleneck for connect/disconnect performance
    now is the LOCK_thd_count mutex.
    
    This patch increases the connect/disconnect performance by
    splitting LOCK_thd_count so that it no longer protects
    several different structures/variables. LOCK_thd_count
    is now only used to protect the list of connections (THDs).
    
    Changes made to existing usage of LOCK_thd_count:
    
    LOCK_thread_cache is introduced to protect the thread cache used
    by the default connection handler (one thread per connection).
    
    Synchronization during startup of signal handler thread is now
    done using LOCK_start_signal_handler.
    
    Synchronization during shutdown of main thread connection
    listening is now done using LOCK_socket_listener_active.
    
    The global thread_id counter is now incremented using atomics,
    rather than being protected by LOCK_thd_count.
    
    THD::current_linfo is now protected by THD::LOCK_thd_data rather
    than LOCK_thd_count.
    
    max_used_connections is now reset under protection of
    LOCK_connection_count rather than LOCK_thd_count.
    6d0e6b99
    WL#7260: Split LOCK_thread_count
    Jon Olav Hauglid authored
    After the improvements made in WL#6606, performance testing has
    shown that the major bottleneck for connect/disconnect performance
    now is the LOCK_thd_count mutex.
    
    This patch increases the connect/disconnect performance by
    splitting LOCK_thd_count so that it no longer protects
    several different structures/variables. LOCK_thd_count
    is now only used to protect the list of connections (THDs).
    
    Changes made to existing usage of LOCK_thd_count:
    
    LOCK_thread_cache is introduced to protect the thread cache used
    by the default connection handler (one thread per connection).
    
    Synchronization during startup of signal handler thread is now
    done using LOCK_start_signal_handler.
    
    Synchronization during shutdown of main thread connection
    listening is now done using LOCK_socket_listener_active.
    
    The global thread_id counter is now incremented using atomics,
    rather than being protected by LOCK_thd_count.
    
    THD::current_linfo is now protected by THD::LOCK_thd_data rather
    than LOCK_thd_count.
    
    max_used_connections is now reset under protection of
    LOCK_connection_count rather than LOCK_thd_count.
Loading