VMS Help  —  CRTL  decc$set_reentrancy
    Controls the type of reentrancy that reentrant Compaq C RTL
    routines will exhibit.

    Format

      #include  <reentrancy.h>

      int decc$set_reentrancy  (int type);

1  –  Argument

 type

    The type of reentrancy desired. Use one of the following values:

    o  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.

    o  C$C_AST - Uses the __TESTBITSSI (Integrity servers, Alpha)
       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 Compaq C RTL I/O routines, or when the user
       application disables ASTs.

    o  C$C_TOLERANT - Uses the
       __TESTBITSSI (Integrity servers, Alpha)  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.

    o  C$C_NONE - Gives optimal performance in the Compaq 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 Compaq 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.

2  –  Description

    Use the decc$set_reentrancy 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.

3  –  Return Value

    type               The type of reentrancy used before this call.
    -1                 The reentrancy was set to a lower type.
Close Help