Controls the type of reentrancy that reentrant DEC C RTL routines will exhibit.
Format
#include <reentrancy.h>
int decc$set_reentrancy (int type);
Argument
- type
- The type of reentrancy desired. Use one of the following values:
- C$C_MULTITHREAD - Designed to be used in conjunction with
the DECthreads product. It performs DECthreads locking and never
disables ASTs. DECthreads must be available on your system to use
this form of reentrancy.
- C$C_AST - Uses the _BBSSI
(VAX only) or __TESTBITSSI
(Alpha only) built-in function to perform simple
locking around critical sections of RTL code, and it may
additionally disable asynchronous system traps (ASTs) in locked
regions of code. This type of locking should be used when AST
code contains calls to DEC C RTL I/O
routines, or when the user application disables ASTs.
- C$C_TOLERANT - Uses the _BBSSI
(VAX only) or __TESTBITSSI
(Alpha only) built-in function to perform simple
locking around critical sections of RTL code, but ASTs are not
disabled. This type of locking should be used when ASTs are
used and must be delivered immediately. TOLERANT is the default
reentrancy type.
- C$C_NONE - Gives optimal performance in the DEC C RTL,
but does absolutely no locking around critical sections of RTL
code. It should only be used in a single-threaded environment
when there is no chance that the thread of execution will be
interrupted by an AST that would call the DEC C RTL.
The reentrancy type can be raised but never lowered. The ordering
of reentrancy types from low to high is C$C_NONE, C$C_TOLERANT, C$C_
AST and C$C_MULTITHREAD. For example, once an application is set to
multithread, a call to set the reentrancy to AST is ignored. A call
to decc$set_reentrancy that attempts to lower the reentrancy type
returns a value of -1.
Description
Use this function to change the type of reentrancy exhibited
by reentrant routines.
decc$set_reentrancy must be called exclusively at the non-AST level.
In an application using DECthreads, DECthreads automatically sets
the reentrancy to multithread.
Return Value
type | The type of reentrancy used
before this call. |
-1 | The
reentrancy was set to a lower type. |
Previous Page | Next Page | Table of Contents | Index