[MDEV-6164] Trim THD by moving out fields specific to system threads Created: 2014-04-24  Updated: 2014-10-13

Status: Open
Project: MariaDB Server
Component/s: None
Fix Version/s: None

Type: Task Priority: Minor
Reporter: Kristian Nielsen Assignee: Kristian Nielsen
Resolution: Unresolved Votes: 0
Labels: None


 Description   

Trim THD by moving out fields specific to system threads

The class THD has a number of fields that are used only in special system
threads (eg. replication SQL/worker threads), yet take up space (and CPU
cache) for all threads.

We should intruduce a THD::system_thread_info, which is a union of pointers to
different structures used in different system threads. So that only a single
pointer needs to be added to the THD to be able to handle all extra
information needed by any special-purpose thread:

  union {
    rpl_io_thread_info *rpl_io_info;
    rpl_sql_thread_info *rpl_sql_info;
    // ...
  } system_thread_info;

Non-exhaustive list of candidates to be moved into this union:

  • rpl_filter
  • rgi_slave
  • is_slave_error
  • slave_expected_error
  • slave_net

In addition, it should be enough to have a single field,
eg. THD::system_thread, that identifies the different system threads and thus
which of the pointers in the system_thread_info union are valid. This should
replace fields such as THD::slave_thread.


Generated at Thu Feb 08 07:09:50 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.