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

os_thread_get_curr_id() et al. introduce unnecessary function call overhead

Details

    Description

      The os0thread.cc module unnecessarily defines non-inlined function call wrappers for trivial operations.

      os_thread_pf() simply casts the argument to a different type, and it should not exist at all.

      The functions os_thread_eq(), os_thread_yield(), os_thread_get_curr_id() are better defined as macros that refer to the Microsoft Windows and POSIX interfaces.

      Because os_thread_get_curr_id() is being invoked in locking code, this simplification could slightly improve performance.

      Attachments

        Activity

          marko Marko Mäkelä created issue -
          marko Marko Mäkelä made changes -
          Field Original Value New Value
          issue.field.resolutiondate 2020-11-30 09:16:48.0 2020-11-30 09:16:48.074
          marko Marko Mäkelä made changes -
          Fix Version/s 10.5.9 [ 25109 ]
          Fix Version/s 10.5 [ 23123 ]
          Resolution Fixed [ 1 ]
          Status Open [ 1 ] Closed [ 6 ]

          For some reason, this change was causing assertion failures in the InnoDB rw_lock_t code on Windows. Hence, I restored os_thread_eq(), os_thread_yield(), os_thread_get_curr_id() as functions on Windows. Such failures were not observed in combination with MDEV-24142.

          marko Marko Mäkelä added a comment - For some reason, this change was causing assertion failures in the InnoDB rw_lock_t code on Windows. Hence, I restored os_thread_eq() , os_thread_yield() , os_thread_get_curr_id() as functions on Windows . Such failures were not observed in combination with MDEV-24142 .

          As part of MDEV-24142 I restored the optimizations for Microsoft Windows in MariaDB 10.6.0. Also os_thread_sleep() will be a macro on Microsoft Windows, but it will remain a function elsewhere.

          marko Marko Mäkelä added a comment - As part of MDEV-24142 I restored the optimizations for Microsoft Windows in MariaDB 10.6.0. Also os_thread_sleep() will be a macro on Microsoft Windows, but it will remain a function elsewhere.
          marko Marko Mäkelä made changes -
          Fix Version/s 10.6.0 [ 24431 ]
          serg Sergei Golubchik made changes -
          Workflow MariaDB v3 [ 116254 ] MariaDB v4 [ 158630 ]

          People

            marko Marko Mäkelä
            marko Marko Mäkelä
            Votes:
            0 Vote for this issue
            Watchers:
            1 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.