aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/erl_db_hash.h
diff options
context:
space:
mode:
authorSverker Eriksson <[email protected]>2016-09-06 17:42:30 +0200
committerSverker Eriksson <[email protected]>2016-09-19 19:46:50 +0200
commit1573603177f5ba641390c67b0515defb2786ecfb (patch)
tree96f4ba4179b9cac3da588d4546ac9937c2d67b09 /erts/emulator/beam/erl_db_hash.h
parentfdc2f2b4a6f6314ae7c183dc4e39e19d05ac89e4 (diff)
downloadotp-1573603177f5ba641390c67b0515defb2786ecfb.tar.gz
otp-1573603177f5ba641390c67b0515defb2786ecfb.tar.bz2
otp-1573603177f5ba641390c67b0515defb2786ecfb.zip
erts: Tweak ets grow/shrink to keep up at contention
Diffstat (limited to 'erts/emulator/beam/erl_db_hash.h')
-rw-r--r--erts/emulator/beam/erl_db_hash.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/erts/emulator/beam/erl_db_hash.h b/erts/emulator/beam/erl_db_hash.h
index 11bd6aa32a..6d25c73549 100644
--- a/erts/emulator/beam/erl_db_hash.h
+++ b/erts/emulator/beam/erl_db_hash.h
@@ -50,17 +50,19 @@ typedef struct db_table_hash_fine_locks {
typedef struct db_table_hash {
DbTableCommon common;
+ /* SMP: szm and nactive are write-protected by is_resizing or table write lock */
+ erts_smp_atomic_t szm; /* current size mask. */
+ erts_smp_atomic_t nactive; /* Number of "active" slots */
+
erts_smp_atomic_t segtab; /* The segment table (struct segment**) */
struct segment* first_segtab[1];
- erts_smp_atomic_t szm; /* current size mask. */
-
+
/* SMP: nslots and nsegs are protected by is_resizing or table write lock */
int nslots; /* Total number of slots */
int nsegs; /* Size of segment table */
/* List of slots where elements have been deleted while table was fixed */
erts_smp_atomic_t fixdel; /* (FixedDeletion*) */
- erts_smp_atomic_t nactive; /* Number of "active" slots */
#ifdef ERTS_SMP
erts_smp_atomic_t is_resizing; /* grow/shrink in progress */
DbTableHashFineLocks* locks;