Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ thr_min_stack(3T) — SunOS 5.4

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

thr_create(3T)

thr_min_stack(3T)

NAME

thr_min_stack − minimum stack space for a thread

SYNOPSIS

#include <thread.h>

size_t thr_min_stack(void);

MT-LEVEL

MT-Safe

DESCRIPTION

When a thread is created with a user-supplied stack, the user must reserve enough space to run this thread. In a dynamically linked execution environment, it is very hard to know what the minimum stack requirments are for a thread.  The function thr_min_stack() returns the amount of space needed to execute a null thread. This is a thread that was created to execute a null procedure. A thread that does something useful should have a stack size that is thr_min_stack() + <some increment>.

Most users should not be creating threads with user-supplied stacks. This functionality was provided to support applications that wanted complete control over their execution environment. 

Typically, users should let the threads library manage stack allocation. The threads library provides default stacks which should meet the requirements of any created thread. 

SEE ALSO

thr_create(3T)

SunOS 5.4  —  Last change: 14 Feb 1994

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026