aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGarrett D'Amore <garrett@damore.org>2017-07-17 11:09:14 -0700
committerGarrett D'Amore <garrett@damore.org>2017-07-17 11:09:14 -0700
commita2c3aae5303b698354fee8a0ebb455791879e367 (patch)
tree765317b759c9adba0082a5d756a34d3ca3320b58 /src
parenta7e3190449b4b60e70177582bd683973e097c6a1 (diff)
downloadnng-a2c3aae5303b698354fee8a0ebb455791879e367.tar.gz
nng-a2c3aae5303b698354fee8a0ebb455791879e367.tar.bz2
nng-a2c3aae5303b698354fee8a0ebb455791879e367.zip
Scalability test fixes.
This fixes a potential nasty bug associated with the objhash table resizing, and rewrites the scalability test to use just a single thread handling some 2000 client sockets. This proves that the framework can deal with vast numbers of sockets, regardless of the supported number of operating system threads.
Diffstat (limited to 'src')
-rw-r--r--src/core/objhash.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/core/objhash.c b/src/core/objhash.c
index 18c55f83..acdcd2c3 100644
--- a/src/core/objhash.c
+++ b/src/core/objhash.c
@@ -316,6 +316,8 @@ nni_objhash_unref_wait(nni_objhash *oh, uint32_t id)
while (node->on_refcnt != 1) {
nni_cv_wait(&oh->oh_cv);
+ // If the table resizes, it can invalidate our old node.
+ node = nni_objhash_find_node(oh, id);
}
node->on_refcnt--;
NNI_ASSERT(node->on_refcnt == 0);