Jump to content United States-English
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
More options
HP.com home
HP-UX Event ManagerProgrammer's Guide: HP-UX 11i v3Edition 1 > Chapter 3 The EVM Programming Interface

EVM Multithreaded Programs

» 

Technical documentation

Complete book in PDF
» Feedback
Content starts here

 » Table of Contents

 » Index

All EVM API functions are thread-safe. In few cases where it is necessary to use internal static storage, the APIs use locks to protect the storage from simultaneous access by separate threads. Nevertheless, if you are using EVM API calls in a multithreaded program, you must take certain precautions to avoid the following synchronization errors:

  1. If possible, restrict the use of any entity returned by any API function to the thread in which it was established. Table 3-1 “Entities to be Thread Safe” lists the entities that must be thread-safe.

    Table 3-1 Entities to be Thread Safe

    EntityTypeReturned by
    Connection contextEvmConnection_tEvmConnCreate()
    EventEvmEvent_t
    EvmEventCreate()
    EvmEventCreateVa()
    EvmEventRead()
    EvmEventDup()
    Data itemEvmItemValue_tEvmItemGet()
    Data item listEvmItemList_tEvmItemListGet()
    VariableEvmVarValue_tEvmVarGet()
    Variable listEvmVarList_tEvmVarListGet()
    Event filterEvmFilter_tEvmFilterCreate()
    Connection fdEvmFd_tEvmConnFdGet()

     

  2. If it is necessary to refer to these entities in more than one thread, you must protect them against simultaneous access, or perform updates by using locks.

If you do not follow these rules, random errors can occur.

Printable version
Privacy statement Using this site means you accept its terms Feedback to webmaster
© 2007 Hewlett-Packard Development Company, L.P.