Inventors:
Clay Bean - Austin TX
Mike Hall - Round Rock TX
Assignee:
National Instruments Corporation - Austin TX
International Classification:
G06F 1314
Abstract:
A system and method which enables a plurality of threads in a multithreaded application to each access per-thread copies of GPIB global variables in a GPIB system. According to the present invention, the plurality of threads use a special set of thread-local GPIB calls to perform the per-thread accesses. Whenever a thread first makes a GPIB call, the GPIB driver software begins maintaining a private copy of all of the GPIB global variables for the respective thread. The driver preferably maintains a separate private copy for each thread. Later, when the thread desires to access a per-thread copy of one or more global variables, the thread uses a thread-local GPIB call to perform the per-thread access. The thread-local functions used to access these per-thread GPIB global variables are ThreadIbsta, ThreadIberr, ThreadIbcnt, and ThreadIbcntl. When the GPIB driver level software receives a call to a thread-local function to access a per-thread global variable, the software determines the appropriate value for the respective thread and returns the per-thread value to the respective requesting thread.