bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

new module 'simple-atomic'


From: Bruno Haible
Subject: new module 'simple-atomic'
Date: Mon, 15 Feb 2021 04:37:30 +0100
User-agent: KMail/5.1.3 (Linux/4.4.0-201-generic; KDE/5.18.0; x86_64; ; )

Most lock-free algorithms use the compare-and-swap primitive in one form or
another. In order to be able to implement such algorithms, here is a module
that implements compare-and-swap for 32-bit words and pointer-sized words.
It's far from a complete <stdatomic.h>, just the bare essentials.

Support for compilers that are not GCC compatible does require work, namely
finding the instructions generated by GCC and putting them in a form that
the non-GCC compiler can grok. So far, this has only been needed for AIX
and Solaris, and fortunately both support inline asms (so that no external .s
file is needed).


2021-02-14  Bruno Haible  <bruno@clisp.org>

        simple-atomic: Add tests.
        * tests/test-simple-atomic.c: New file.
        * modules/simple-atomic-tests: New file.

        simple-atomic: New module.
        * lib/simple-atomic.h: New file.
        * lib/simple-atomic.c: New file, based on lib/asyncsafe-spin.c.
        * modules/simple-atomic: New file.

Attachment: 0001-simple-atomic-New-module.patch
Description: Text Data

Attachment: 0002-simple-atomic-Add-tests.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]