Dismiss
InnovationQ will be updated on Sunday, Oct. 22, from 10am ET - noon. You may experience brief service interruptions during that time.
Browse Prior Art Database

Operating System/2 Memory Management Extension

IP.com Disclosure Number: IPCOM000119677D
Original Publication Date: 1991-Feb-01
Included in the Prior Art Database: 2005-Apr-02
Document File: 1 page(s) / 48K

Publishing Venue

IBM

Related People

Atkinson, RL: AUTHOR [+2]

Abstract

A program is disclosed that deallocates a stack for threads, only after assuring that the thread has exited.

This text was extracted from an ASCII text file.
This is the abbreviated version, containing approximately 61% of the total text.

Operating System/2 Memory Management Extension

      A program is disclosed that deallocates a stack for
threads, only after assuring that the thread has exited.

      The OS/2* operating system requires the user to allocate a
stack for every thread that is started.  Since OS/2 does not do the
stack allocation, it also does not free the stack at the thread's
termination.  When the thread "exits", there is no assurance that the
thread has terminated because of CPU sharing with other processes,
threads, etc.  If the stack is deallocated prior to the thread's
termination, a storage violation will occur.  If the stack is not
deallocated, and threads continue to be started, a shortage of memory
will occur and the system will halt.

      At "thread start" time, the thread ID and the address of the
thread's stack are placed in an available index of the global thread
array.  This index's status is marked as being "full".  The fact that
the index's status is full indicates to the clean-up routine that
this thread is still active and should not be considered for stack
clean-up.

      When a thread is ready to end, the semaphore for the global
thread array is latched, and the array is searched for the thread's
ID.  When the ID is found, the status of the index is changed to
"exiting", indicating that the thread has called OS/2 to exit the
thread.  Also another semaphore is posted which allows the "Master
Thread Cleanup" routine to scan the global thread arra...