Skip to content
Snippets Groups Projects
  • Rhys Hiltner's avatar
    18c2461a
    runtime: allow futex OSes to use sema-based mutex · 18c2461a
    Rhys Hiltner authored
    Implement sema{create,sleep,wakeup} in terms of the futex syscall when
    available. Split the lock2/unlock2 implementations out of lock_sema.go
    and lock_futex.go (which they shared with runtime.note) to allow
    swapping in new implementations of those.
    
    Let futex-based platforms use the semaphore-based mutex implementation.
    Control that via the new "spinbitmutex" GOEXPERMENT value, disabled by
    default.
    
    This lays the groundwork for a "spinbit" mutex implementation; it does
    not include the new mutex implementation.
    
    For #68578.
    
    Change-Id: I091289c85124212a87abec7079ecbd9e610b4270
    Reviewed-on: https://go-review.googlesource.com/c/go/+/622996
    
    
    Reviewed-by: default avatarMichael Knyszek <mknyszek@google.com>
    Reviewed-by: default avatarCherry Mui <cherryyz@google.com>
    LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
    18c2461a
    History
    runtime: allow futex OSes to use sema-based mutex
    Rhys Hiltner authored
    Implement sema{create,sleep,wakeup} in terms of the futex syscall when
    available. Split the lock2/unlock2 implementations out of lock_sema.go
    and lock_futex.go (which they shared with runtime.note) to allow
    swapping in new implementations of those.
    
    Let futex-based platforms use the semaphore-based mutex implementation.
    Control that via the new "spinbitmutex" GOEXPERMENT value, disabled by
    default.
    
    This lays the groundwork for a "spinbit" mutex implementation; it does
    not include the new mutex implementation.
    
    For #68578.
    
    Change-Id: I091289c85124212a87abec7079ecbd9e610b4270
    Reviewed-on: https://go-review.googlesource.com/c/go/+/622996
    
    
    Reviewed-by: default avatarMichael Knyszek <mknyszek@google.com>
    Reviewed-by: default avatarCherry Mui <cherryyz@google.com>
    LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Code owners
Assign users and groups as approvers for specific file changes. Learn more.