Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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...
commit 7419e64abad750ecb1afd47f71919d8917e4fecd 1 parent 275eebf
Alvaro Lopez Ortega alobbs authored

Showing 1 changed file with 6 additions and 1 deletion. Show diff stats Hide diff stats

  1. +6 1 main.c
7 main.c
@@ -40,6 +40,7 @@
40 40 #define REQUEST_NUM_DEFAULT 10000
41 41 #define KEEPALIVE_DEFAULT 0
42 42 #define RESPONSES_COUNT_LEN 10
  43 +#define THREAD_STACK_SIZE 80 * 1024
43 44
44 45 #define APP_VERSION "0.1"
45 46 #define APP_NAME "Cherokee Benchmark"
@@ -301,6 +302,7 @@ thread_launch (cherokee_list_t *threads, int num)
301 302 int re;
302 303 cb_thread_t *thread;
303 304 cherokee_list_t *item;
  305 + pthread_attr_t attr;
304 306
305 307 /* Create threads
306 308 */
@@ -314,7 +316,10 @@ thread_launch (cherokee_list_t *threads, int num)
314 316 pthread_mutex_init (&thread->start_mutex, NULL);
315 317 pthread_mutex_lock (&thread->start_mutex);
316 318
317   - re = pthread_create (&thread->pthread, NULL, thread_routine, thread);
  319 + pthread_attr_init (&attr);
  320 + pthread_attr_setstacksize (&attr, THREAD_STACK_SIZE);
  321 +
  322 + re = pthread_create (&thread->pthread, &attr, thread_routine, thread);
318 323 if (re != 0) {
319 324 PRINT_ERROR_S ("Couldn't create pthread\n");
320 325

0 comments on commit 7419e64

Please sign in to comment.
Something went wrong with that request. Please try again.