Permalink
Browse files

Points pthread to allocate an 80k stack for each one of the threads.

git-svn-id: svn://cherokee-project.com/benchmark@3519 5dc97367-97f1-0310-9951-d761b3857238
  • Loading branch information...
1 parent 275eebf commit 7419e64abad750ecb1afd47f71919d8917e4fecd @alobbs alobbs committed Aug 5, 2009
Showing with 6 additions and 1 deletion.
  1. +6 −1 main.c
View
7 main.c
@@ -40,6 +40,7 @@
#define REQUEST_NUM_DEFAULT 10000
#define KEEPALIVE_DEFAULT 0
#define RESPONSES_COUNT_LEN 10
+#define THREAD_STACK_SIZE 80 * 1024
#define APP_VERSION "0.1"
#define APP_NAME "Cherokee Benchmark"
@@ -301,6 +302,7 @@ thread_launch (cherokee_list_t *threads, int num)
int re;
cb_thread_t *thread;
cherokee_list_t *item;
+ pthread_attr_t attr;
/* Create threads
*/
@@ -314,7 +316,10 @@ thread_launch (cherokee_list_t *threads, int num)
pthread_mutex_init (&thread->start_mutex, NULL);
pthread_mutex_lock (&thread->start_mutex);
- re = pthread_create (&thread->pthread, NULL, thread_routine, thread);
+ pthread_attr_init (&attr);
+ pthread_attr_setstacksize (&attr, THREAD_STACK_SIZE);
+
+ re = pthread_create (&thread->pthread, &attr, thread_routine, thread);
if (re != 0) {
PRINT_ERROR_S ("Couldn't create pthread\n");

0 comments on commit 7419e64

Please sign in to comment.