Please note, this is a STATIC archive of website developer.mozilla.org from 03 Nov 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

Atomic Operations

This chapter describes the global functions you use to perform atomic operations. The functions define a portable API that may be reliably used in any environment. Since not all operating environments provide access to such functions, their performance may vary considerably.

Atomic Operations Functions

The API defined for the atomic functions is consistent across all supported platforms. However, the implementation may vary greatly, and hence the performance. On systems that do not provide direct access to atomic operators, NSPR emulates the capabilities by using its own locking mechanisms. For such systems, NSPR performs atomic operations just as efficiently as the client could. Therefore, to preserve portability, it is recommended that clients use the NSPR API for atomic operations.

These functions operate on 32-bit integers:

These functions implement a simple stack data structure:

Document Tags and Contributors

 Contributors to this page: teoli, Sheppy, trevorh, Jorend, Rappo
 Last updated by: teoli,