Openvms Programming Concepts Manual, Vol. 1

Openvms Programming Concepts Manual, Vol. 1

OpenVMS Programming Concepts Manual, Volume I Order Number: AA–RNSHA–TE April 2001 This manual is volume one of two volumes. It describes the features that the OpenVMS operating system provides to programmers in the following areas: • Process and Synchronization • Interrupts and Condition Handling • Addressing and Memory Management Revision/Update Information: This manual supersedes the OpenVMS Programming Concepts Manual, Version 7.2. Software Version: OpenVMS Alpha Version 7.3 OpenVMS VAX Version 7.3 Compaq Computer Corporation Houston, Texas © 2001 Compaq Computer Corporation Compaq, AlphaServer, VAX, VMS, and the Compaq logo Registered in U.S. Patent and Trademark Office. Alpha, OpenVMS, PATHWORKS, DECnet, and DEC are trademarks of Compaq Information Technologies Group, L.P. in the United States and other countries. UNIX and X/Open are trademarks of The Open Group in the United States and other countries. All other product names mentioned herein may be trademarks of their respective companies. Confidential computer software. Valid license from Compaq required for possession, use, or copying. Consistent with FAR 12.211 and 12.212, Commercial Computer Software, Computer Software Documentation, and Technical Data for Commercial Items are licensed to the U.S. Government under vendor’s standard commercial license. Compaq shall not be liable for technical or editorial errors or omissions contained herein. The information in this document is provided "as is" without warranty of any kind and is subject to change without notice. The warranties for Compaq products are set forth in the express limited warranty statements accompanying such products. Nothing herein should be construed as constituting an additional warranty. Printed in the U.S.A. ZK6640 The Compaq OpenVMS documentation set is available on CD-ROM. Contents Preface ............................................................ xix 1 Overview of Manuals and Introduction to Development on OpenVMS Systems 1.1 Overview of the Manual ....................................... 1–1 1.2 Overview of the OpenVMS Operating System ...................... 1–2 1.3 Components of the OpenVMS Operating System .................... 1–3 1.3.1 OpenVMS Systems on Multiple Platforms ...................... 1–4 1.3.1.1 System Compatibility and Program Portability Across Platforms ............................................ 1–5 1.3.2 OpenVMS Computing Environments . ....................... 1–5 1.3.2.1 Open System Capabilities ............................... 1–5 1.3.2.2 Application Portability . ................................ 1–6 1.3.2.2.1 Other Application Portability Features . ............... 1–6 1.3.3 Distributed Computing Capabilities ........................... 1–6 1.3.3.1 Client/Server Style of Computing . ....................... 1–6 1.3.3.2 OpenVMS Client/Server Capabilities ....................... 1–7 1.4 The OpenVMS Programming Environment . ....................... 1–7 1.4.1 Programming to Standards . ................................ 1–9 1.4.1.1 Common Environment for Writing Code .................... 1–9 1.4.1.2 Common Language Environment . ....................... 1–9 1.5 OpenVMS Programming Software ............................... 1–9 1.5.1 Creating Program Source Files .............................. 1–10 1.5.2 Creating Object Files ...................................... 1–11 1.5.3 Creating Runnable Programs ................................ 1–12 1.5.4 Testing and Debugging Programs ............................ 1–13 1.5.4.1 Special Modes of Operation for Debugging ................... 1–14 1.5.5 Using Other Program Development Utilities .................... 1–14 1.5.6 Managing Software Development Tasks . ....................... 1–15 1.6 Using Callable System Routines ................................ 1–15 1.6.1 Using the POSIX Threads Library Routines .................... 1–15 1.6.2 Using OpenVMS Run-Time Library Routines ................... 1–16 1.6.3 Using OpenVMS System Services ............................ 1–17 1.6.4 Using OpenVMS Utility Routines ............................ 1–18 1.7 Programming User Interfaces . ................................ 1–19 1.8 Developing Real-Time Applications .............................. 1–20 1.9 Optional Compaq Software Development Tools ..................... 1–20 1.10 Managing Data ............................................. 1–20 1.10.1 RMS Files and Records .................................... 1–21 1.10.2 RMS Utilities ............................................ 1–21 iii Part I Process and Synchronization 2 Process Creation 2.1 Process Types . ............................................ 2–1 2.2 Execution Context of a Process ................................. 2–2 2.3 Modes of Execution of a Process ................................. 2–2 2.4 Creating a Subprocess ........................................ 2–3 2.4.1 Using LIB$SPAWN to Create a Spawned Subprocess . ........... 2–3 2.4.2 Using the C system( ) Call .................................. 2–6 2.4.3 Using SYS$CREPRC to Create a Subprocess ................... 2–6 2.4.3.1 Disk and Directory Defaults for Created Processes . ........... 2–12 2.5 Creating a Detached Process ................................... 2–13 2.6 Process Quota Lists .......................................... 2–14 2.7 Debugging a Subprocess or a Detached Process . ................... 2–15 2.8 Kernel Threads and the Kernel Threads Process Structure (Alpha Only) .......................................................... 2–17 2.8.1 Definition and Advantages of Kernel Threads ................... 2–17 2.8.2 Kernel Threads Features ................................... 2–17 2.8.2.1 Multiple Execution Contexts Within a Process ................ 2–17 2.8.2.2 Efficient Use of the OpenVMS and POSIX Threads Library Schedulers ........................................... 2–18 2.8.2.3 Terminating a POSIX Threads Image . ................... 2–18 2.8.3 Kernel Threads Model and Design Features . ................... 2–19 2.8.3.1 Kernel Threads Model .................................. 2–19 2.8.3.2 Kernel Threads Design Features .......................... 2–19 2.8.3.2.1 Process Structure ................................... 2–19 2.8.3.2.2 Access to Inner Modes . ............................ 2–20 2.8.3.2.3 Scheduling ........................................ 2–20 2.8.3.2.4 ASTs............................................ 2–20 2.8.3.2.5 Event Flags . .................................... 2–20 2.8.3.2.6 Process Control Services . ............................ 2–20 2.8.4 Kernel Threads Process Structure ............................ 2–20 2.8.4.1 Process Control Block (PCB) and Process Header (PHD) ........ 2–21 2.8.4.1.1 Effect of a Multithreaded Process on the PCB and PHD . 2–21 2.8.4.2 Kernel Thread Block (KTB) . ............................ 2–21 2.8.4.3 Floating-Point Registers and Execution Data Blocks (FREDs) . 2–22 2.8.4.4 Kernel Threads Region ................................. 2–22 2.8.4.5 Per-Kernel Thread Stacks . ............................ 2–22 2.8.4.6 Per-Kernel-Thread Data Cells ............................ 2–23 2.8.4.7 Summary of Process Data Structures . ................... 2–23 2.8.4.8 Kernel Thread Priorities ................................ 2–23 3 Process Communication 3.1 Communication Within a Process ................................ 3–1 3.1.1 Using Local Event Flags ................................... 3–2 3.1.2 Using Logical Names . .................................... 3–2 3.1.2.1 Using Logical Name Tables . ............................ 3–2 3.1.2.2 Using Access Modes .................................... 3–2 3.1.2.3 Creating and Accessing Logical Names . ................... 3–2 3.1.3 Using Command Language Interpreter Symbols ................. 3–5 3.1.3.1 Local and Global Symbols . ............................ 3–5 3.1.3.2 Creating and Using Global Symbols ........................ 3–5 iv 3.1.4 Using the Common Area . ................................ 3–6 3.1.4.1 Creating the Process Common Area . ....................... 3–6 3.1.4.2 Common I/O Routines . ................................ 3–6 3.1.4.3 Modifying or Deleting Data in the Common Block ............. 3–6 3.1.4.4 Specifying Other Types of Data ........................... 3–6 3.2 Communication Between Processes .............................. 3–7 3.2.1 Mailboxes ............................................... 3–8 3.2.1.1 Creating a Mailbox .................................... 3–9 3.2.1.2 Creating Temporary and Permanent Mailboxes ............... 3–9 3.2.1.3 Assigning an I/O Channel Along with a Mailbox .............. 3–10 3.2.1.4 Reading and Writing Data to a Mailbox ..................... 3–11 3.2.1.5 Using Synchronous Mailbox I/O ........................... 3–12 3.2.1.6 Using Immediate Mailbox I/O ............................ 3–14 3.2.1.7 Using Asynchronous Mailbox I/O . ....................... 3–17 3.3 Intra-Cluster Communication . ................................ 3–21 3.3.1 Programming with Intra-Cluster Communications ............... 3–22 3.3.1.1 ICC Concepts . ........................................ 3–22 3.3.1.2 Design Considerations . ................................ 3–23 3.3.1.2.1 Naming . ........................................ 3–23 3.3.1.2.2 Message Ordering . ................................ 3–23 3.3.1.2.3 Flow Control ...................................... 3–23 3.3.1.2.4 Transfer Sizes and Receiving Data ...................... 3–23 3.3.1.2.5 Transfer Sizes and Transceive . ....................... 3–24 3.3.1.2.6 Disconnection ...................................... 3–24 3.3.1.2.7

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    532 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us