UNIX Portable Atomic Operations

前端 未结 7 1354
生来不讨喜
生来不讨喜 2020-12-05 07:01

Is there a (POSIX-)portable way in C for atomic variable operations similar to a portable threading with pthread?

Atomic operations are operations like \"increment a

7条回答
  •  攒了一身酷
    2020-12-05 07:40

    For anyone who stumbles upon this in the future, C11 atomics are the best way to do this now - I believe they will be included in GCC 4.9.

提交回复
热议问题