Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Register
  • Sign in
  • G GLib
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 853
    • Issues 853
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 54
    • Merge requests 54
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • GNOMEGNOME
  • GLib
  • Merge requests
  • !1123

gatomic: Use new __atomic_*() intrinsics for all atomic operations

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Philip Withnall requested to merge pwithnall/glib:1750-more-atomic-intrinsics into master Sep 21, 2019
  • Overview 11
  • Commits 3
  • Pipelines 8
  • Changes 4

Previously we used the old __sync_fetch_*() intrinsics for some of the atomic operations, such as g_atomic_int_compare_and_exchange(). When available, use the new __atomic_*() intrinsics for those instead.

As with the rest of our use of __atomic_*() intrinsics, we use the __ATOMIC_SEQ_CST memory model. If people want to use a less restrictive memory model to get better performance in certain situations, they can use the compiler intrinsics directly themselves. g_atomic_*() aim to be as fast as possible while remaining general purpose.

Tested using:

meson test --repeat 1000 atomic atomic-test

Signed-off-by: Philip Withnall withnall@endlessm.com

Fixes: #1750 (closed)

Edited Sep 25, 2019 by Philip Withnall
Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: 1750-more-atomic-intrinsics