previous | start | next

Setting the Stack Size

Example: Request a 20Mb stack:

pthread_t thread;
pthread_attr_t thr_attr;

pthread_attr_init(&thr_attr);
pthread_attr_setstacksize(&thr_attr, 20 * 1024 * 1024);
...
pthread_create(&thread, &thr_attr, start, arg);


previous | start | next