Uploaded image for project: 'WiredTiger'
  1. WiredTiger
  2. WT-11940

Review the use of __wt_yield (sched_yield)

    • Type: Icon: Technical Debt Technical Debt
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • 13
    • StorEng - Refinement Pipeline

      WT makes use of the system API call sched_yield() through the portability wrapper __wt_yield(). However on Linux this call is non-deterministic unless used with the real-time scheduling policies SCHED_FIFO or SCHED_RR.

      WT threads uses the default scheduling policy SCHED_DEFAULT also know as SCHED_OTHER.

      The default Linux manual page is scornful of the use of sched_yield with the SCHED_OTHER policy:

      sched_yield()  is intended for use with real-time scheduling policies (i.e., SCHED_FIFO or SCHED_RR).  Use of sched_yield() with nondeterministic scheduling policies such as SCHED_OTHER is unspecified and very likely means your application design is broken.
      

      In consideration of this, revisiting the expectations and use of __wt_yield() is merited.

      Notes:

      • Windows porting layer uses SwitchThread() which has clear semantics.
      • The behavior of sched_yield() in the MacOS microkernel should not be assumed to be the same.

      This ticket is ambiguous as it involves research and consensus building as a prerequisite to any actual coding required.

            Assignee:
            backlog-server-storage-engines [DO NOT USE] Backlog - Storage Engines Team
            Reporter:
            marc.butler@mongodb.com Marc Butler (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated: