5.1.3 #pragma _KAP no side effects ( name [,name...] )

C functions frequently produce more information than just the returned value. Changing values of arguments with pointers or arrays, changing global data, and I/O make a function unsafe to parallelize. The no side effects assertion indicates that all of the functions named can be assumed to be safe to execute concurrently. This means that they perform no I/O and they modify only local variables. If pointers or array names are passed to the routines, it is assumed that the memory locations they represent are not modified. The functions named by the #pragma _KAP no side effects () must have been declared before the assertion.

The #pragma _KAP no side effects () assertion tells KAP to assume that all external functions are thread-reentrant. This will override KAP default behavior, which is to assume that all external functions are not thread-reentrant or thread-safe. If the external functions are not thread-safe, and you use #pragma _KAP no side effects () , your program may not execute correctly. For example, local variables in functions are thread-safe only if they are stored as thread-specific data. See the Guide to DECthreads for further information on thread-safe functions.

Previous Page | Next Page | Contents | Index |
Command-Line Qualifiers

Copyright © Digital Equipment Corporation. 1999. All Rights Reserved.