From 0b04f9de253d2bffde5fa718476abeb7dcfe3f54 Mon Sep 17 00:00:00 2001 From: Alexander Boettcher Date: Tue, 29 Apr 2014 10:57:39 +0200 Subject: [PATCH] run: limit created threads in test The rm_session quota of the context area is not sufficient to start more then ~95 threads per address space. If one really needs so many threads per address space one could increase the quota or dynamically respond to it using the Expanding_rm_session class. Until now there is no need to support so much threads per address space. Issue #1122 --- base/src/test/thread/main.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/base/src/test/thread/main.cc b/base/src/test/thread/main.cc index 8392da6cb..74f6e846d 100644 --- a/base/src/test/thread/main.cc +++ b/base/src/test/thread/main.cc @@ -51,7 +51,7 @@ static void test_context_alloc() * Create HELPER threads, which concurrently create CHILDREN threads each. * This most likely triggers any race in the thread-context allocation. */ - enum { HELPER = 10, CHILDREN = 10 }; + enum { HELPER = 10, CHILDREN = 9 }; Helper helper[HELPER]; @@ -166,6 +166,7 @@ struct Cpu_helper : Thread<0x1000> } }; + static void test_cpu_session() { Cpu_helper thread0("prio high ", env()->cpu_session()); @@ -183,8 +184,11 @@ static void test_cpu_session() thread2.join(); } + int main() { + printf("--- thread test started ---\n"); + try { test_context_alloc(); test_stack_alignment();