carb/container/LocklessStack.h

↰ Parent directory: carb/container/

Defines the LocklessStack class.

Source: carb/container/LocklessStack.h

Included By

Namespaces

Classes

Defines

  • CARB_LOCKLESSSTACK_IS_LOCKLESS: On non-Windows platforms we fallback to a non-Lockless version that uses a mutex. This is because handling a pop() requires potentially catching a SIGSEGV to restart the operation (similar to a cmpxchg failing). On Windows this is easily done with SEH (Structured Exception Handling), but on Linux this requires a signal handler. If this file is compiled into multiple dynamic objects then multiple signal handlers will be registered. Furthermore, the signal handler of the currently active LocklessStack needs to be at the beginning of the handler chain. This is untenable from a performance perspective. Therefore we use a mutex to ensure that all reads will be safe.