Ingres CL TH

From Ingres Community Wiki

Jump to: navigation, search

Ingres Compatability Library
Architecture - Overview - Suggestions - GL: BA - BT - ERGL - handy - HSH - LC - LL - MEGL - MM - MO - MU - PM - SP - TMGL - CL: CI - CK - CM - CP - CS - CSMT - CV - CX - DI - DL - DS - ER - ERold - EX - FP - GC - GV - handy - ID - JF - LG - LK - LO - ME - MH - NM - OL - PC - PE - QU - SA - SI - SR - ST - TC - TE - TH - TM - TR - UT

Contents

Compatibility Library Specification - TH

Abstract

This is the specification of the TH facility provided by the compatibility library for thread management outside of DBMS-class servers.

Revision: 1.0, 15-May-2008

Document History

  • Revision 1.0, last modified 15-May-2008.

Specification

Introduction

The routines in the TH module allow Ingres applications and utilities to manage threads. The TH module is not intended for DBMS-class servers; it is designed to be independent of the CS and CSMT modules.

All of these routines should be treated as void. Status is reported as an output argument. Exceptions may be generated from the underlying thread functions.

These routines can be implemented in a system independent fashion.

Library

CL

Header File <th.h>

The header file <th.h> must be included before using any of the functions provided. The <th.h> file is located at gl!hdr!hdr.

The <th.h> header file includes a <thcl.h> file. There are three versions of <thcl.h>, one each for Windows, Unix/Linux, and VMS. Each <thcl.h> file consists of macro defintions for POSIX thread functions, if POSIX is supported on the platform in question. Otherwise, thread functions are defined as appropriate, similar to the treatment in the CSMT module.

Executable Interface

The following functions are provided:

TH_create_thread

Create a new thread.

Inputs:

stackSize size of the thread stack in bytes
stackAddress address of the stack
startFunction address of function executed by the thread
functionArgs structure of arguments passed to the thread
flags either TH_JOINABLE (thread can be joined) or TH_DETACHED (thread is detached)

Outputs:

threadID identification number of the thread
statusPtr pointer to the return status, corresponding to the operating status of the underlying thread.

Definition:

void
TH_create_thread (stackSize, stackAddress, startFunction, functionArgs,
                            flags, threadID, statusPtr)
size_t   stackSize;
void * stackAddress;
void * startFunction;
void * functionArgs;
TH_THREAD_ID * threadID;
STATUS * statusPtr;

TH_exit_thread

Return from and terminate the current thread.

Inputs:

None

Outputs:

statusPtr pointer to the return status, corresponding to the operating status of the underlying thread.

Definition:

void 
TH_exit_thread (statusPtr)
 STATUS *statusPtr;


TH_join_thread

Wait for a thread to terminate. Waiting for a thread is termed "joining" a thread.

Inputs:

None

Outputs:

threadID thread identification number of the thread to be joined.
statusPtr pointer to the return status, corresponding to the operating status of the underlying thread.

Definition:

void 
TH_join_thread (threadID,statusPtr)
 TH_THREAD_ID threadID;
 STATUS *statusPtr;

Ingres Compatability Library
Architecture - Overview - Suggestions - GL: BA - BT - ERGL - handy - HSH - LC - LL - MEGL - MM - MO - MU - PM - SP - TMGL - CL: CI - CK - CM - CP - CS - CSMT - CV - CX - DI - DL - DS - ER - ERold - EX - FP - GC - GV - handy - ID - JF - LG - LK - LO - ME - MH - NM - OL - PC - PE - QU - SA - SI - SR - ST - TC - TE - TH - TM - TR - UT

Personal tools
Developing With