previous | start | next

Thread Attributes

Using 0 for the thread attribute argument of pthread_create will result in a default value for the stack size for that thread.

Example.

Suppose we are creating 1024 threads, each with a default stack size of 8Mb (default value in some versions of POSIX threads on Linux).

This would require 8Gb of address space.

But a 32bit machine has only 4Gb of address space.

So to get 1024 threads, each one would have to use a smaller stack size.



previous | start | next