summaryrefslogtreecommitdiff
path: root/accel-pppd/triton
diff options
context:
space:
mode:
authorKozlov Dmitry <xeb@mail.ru>2012-07-30 23:19:36 +0400
committerKozlov Dmitry <xeb@mail.ru>2012-07-30 23:19:36 +0400
commit994905a05a6388cb9e832e09c05bb6a363c73ecc (patch)
treebb51e5ca9cbe5429c3c1a93a8b5292649fece137 /accel-pppd/triton
parent8b6ea70a163d0cfc84394a7241a4dad8a0bf2051 (diff)
downloadaccel-ppp-xebd-994905a05a6388cb9e832e09c05bb6a363c73ecc.tar.gz
accel-ppp-xebd-994905a05a6388cb9e832e09c05bb6a363c73ecc.zip
make worker stack size configurable
Diffstat (limited to 'accel-pppd/triton')
-rw-r--r--accel-pppd/triton/triton.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/accel-pppd/triton/triton.c b/accel-pppd/triton/triton.c
index 897a4ea..cf06cea 100644
--- a/accel-pppd/triton/triton.c
+++ b/accel-pppd/triton/triton.c
@@ -10,11 +10,10 @@
#include "triton_p.h"
#include "memdebug.h"
-#define WORKER_STACK_SIZE 1024*1024
-
int thread_count = 2;
int thread_count_max = 200;
int max_events = 64;
+int conf_stack_size = 1024*1024;
static spinlock_t threads_lock = SPINLOCK_INITIALIZER;
static LIST_HEAD(threads);
@@ -247,7 +246,7 @@ struct _triton_thread_t *create_thread()
}
pthread_attr_init(&attr);
- pthread_attr_setstacksize(&attr, WORKER_STACK_SIZE);
+ pthread_attr_setstacksize(&attr, conf_stack_size);
memset(thread, 0, sizeof(*thread));
pthread_mutex_init(&thread->sleep_lock, NULL);
@@ -622,6 +621,10 @@ void __export triton_run()
if (opt && atoi(opt) > 0)
thread_count_max = atoi(opt);
+ opt = conf_get_opt("core", "stack-size");
+ if (opt && atoi(opt) > 0)
+ conf_stack_size = atoi(opt);
+
for(i = 0; i < thread_count; i++) {
t = create_thread();
if (!t)