Skip to content

Commit e43ad71

Browse files
committed
Add note about new memory bariers
1 parent 5afd748 commit e43ad71

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

ext/concurrent/atomic_reference.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,16 @@
77
/*#include <libkern/OSAtomic.h>*/
88
/*#endif*/
99

10+
/*
11+
Following the wisdom of postgres, we opt to use platform specific memory barriers when available.
12+
These are generally more performant. In this PR, we add specific cases for i386, x86_64.
13+
14+
In the future, we could look at using pg's atomics library directly:
15+
https://github.com/postgres/postgres/tree/9d4649ca49416111aee2c84b7e4441a0b7aa2fac/src/include/port/atomics
16+
17+
Point of contact @ianks
18+
*/
19+
1020
#include "atomic_reference.h"
1121

1222
#if (defined(__i386__) || defined(__i386)) && (defined(__GNUC__) || defined(__INTEL_COMPILER))

0 commit comments

Comments
 (0)