Company Events Academic NI Developer Zone Support Solutions Products & Services Contact NI MyNI

Using C Code That is Thread Safe

LabVIEW 8.5 Help
August 2007

NI Part Number:
371361D-01

»View Product Info

The CINProperties function only labels your CIN as being safe to run from multiple threads. Whether the CIN is actually thread safe depends entirely upon what C code has been written. For information about what makes C code safe or unsafe to be run from multiple threads simultaneously, please consult C programming documentation. The following characteristics are the basic characteristics of thread safe code in a CIN.

  • The code is thread safe when it does not store any unprotected global data, such as global variables, files on disk, and so on.
  • The code is thread safe when it does not access any hardware. In other words, the code does not contain register-level programming.
  • The code is thread safe when it does not make any calls to any functions, shared libraries, or drivers that are not thread safe.
  • The code is thread safe when it uses semaphores or mutexes to protect access to global resources.
  • The CIN call is thread safe when only one non-reentrant VI calls the CIN.
  • The CIN call is thread safe when the code does not access any global resources through CIN housekeeping routines, such as CINInit, CINAbort, CINDispose, and others.

Resources


 

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
Add Comments 1 2 3 4 5 submit