[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Thread creation and stack allocation

From: Mark Kettenis
Subject: Re: Thread creation and stack allocation
Date: Mon, 2 Jul 2001 11:10:00 +0200

   From: Igor Khavkine <i_khavki@alcor.concordia.ca>
   Date: Mon, 2 Jul 2001 01:37:59 -0400

   On Sun, Jul 01, 2001 at 08:27:17PM -0400, Igor Khavkine wrote:
   > In this case, should the creation of the "red zone" be the programmer's
   > responsibility, or is there a way to create it with the library?
   > It is also possible that I'm misinterpreting the standard, if so, please
   > let me know.

   I've looked further in the standard and found the functions
   pthread_attr_{get,set}guardsize(). These control the size of the
   "red zone" or guard zone at the end of the stack. However the
   documentation is moot and does not specify whether the guard area
   is part of STACKSIZE set by the user with ptread_attr_{get,set}stacksize().

   Clarifications, are more then welcome.

The page for pthread_attr{get,set}guardsize() in the current POSIX
draft says:

   if the STACKADDR or STACK attribute has been set (that is, the
   caller is allocating and managing its own thread stacks), the
   GUARDSIZE attribute shall be ignored and no protection shall be
   provided by the implementation.  It is the responsibility of the
   application to manage stack overflow along with stack allocation
   and management in this case.

Changebars in the draft indicate that this is a recent addition.  See
http://www.opengroup.org/austin on how to get the current POSIX draft.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]