From a2c3aae5303b698354fee8a0ebb455791879e367 Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Mon, 17 Jul 2017 11:09:14 -0700 Subject: 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. --- src/core/objhash.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') 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); -- cgit v1.2.3-70-g09d2