Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-33748

get rid of pthread_key_(get_/set_)specific API, replace with C-style thread_local

    XMLWordPrintable

Details

    Description

      Every major compiler has some notion of thread local storage

      In C++11, there is thread_local , as per standard.

      In C, in the newer standards, it is _Thread_local (C11) , or thread_local (C23) , and before that all relevant compiler have had notion of "thread local variable" for many years , i.e __thread in GCC or __declspec(thread) in MSVC,

      Apart from better performance when accessing thread local variables, we'll get rid of things that depend on
      initialization/cleanup of pthread_key_t variables.

      "/tmp/workspace/Source-Build-Test/src/storage/perfschema/pfs.cc", line=line@entry=1379, function=function@entry=0xaaaad18df558 "void my_thread_set_THR_PFS(PFS_thread*)") at assert.c:92
      #7  0x0000ffffa19e9684 in __GI___assert_fail (assertion=0xaaaad18df508 "THR_PFS_initialized", file=0xaaaad18df4c8 "/tmp/workspace/Source-Build-Test/src/storage/perfschema/pfs.cc", line=1379, function=0xaaaad18df558 "void my_thread_set_THR_PFS(PFS_thread*)") at assert.c:101
      

      Attachments

        Issue Links

          Activity

            People

              wlad Vladislav Vaintroub
              wlad Vladislav Vaintroub
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.