Default Stack Size 0??

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Default Stack Size 0??

sivachandra
Hi,

You can consider me to be a newbie to pthreads-win32. I downloaded and
am using pthreads-2.8.0 static library and dll binaries with MinGW. I
find the default stack size to be zero. Consider the code snippet
below:

    pthread_attr_t attr;
    pthread_attr_init(&attr);

    size_t defStackSize;
    pthread_attr_getstacksize(&attr, &defStackSize);

    cout << "Default stack size = " << defStackSize << endl;

The above code prints 0! Does this mean that I cannot use the default
attributes in most but the simplest of my application??

Thanks and regards,
Siva Chandra
Reply | Threaded
Open this post in threaded view
|

Re: Default Stack Size 0??

Phil Frisbie, Jr.
On Windows a stack size of "0" means the size is inherited from the parent
thread.

On Tue, October 6, 2009 6:37 pm, Siva Chandra wrote:

> Hi,
>
> You can consider me to be a newbie to pthreads-win32. I downloaded and
> am using pthreads-2.8.0 static library and dll binaries with MinGW. I
> find the default stack size to be zero. Consider the code snippet
> below:
>
>     pthread_attr_t attr;
>     pthread_attr_init(&attr);
>
>     size_t defStackSize;
>     pthread_attr_getstacksize(&attr, &defStackSize);
>
>     cout << "Default stack size = " << defStackSize << endl;
>
> The above code prints 0! Does this mean that I cannot use the default
> attributes in most but the simplest of my application??
>
> Thanks and regards,
> Siva Chandra

--
Phil Frisbie, Jr.
Hawk Software
http://www.hawksoft.com