2. Thread Object
3. Event Object

System Configuration


    Table 1 shows a breakdown of all files which are included in the compilation of all components of the library, along with a description. An OSI_Threads component must be include all of these files on the respective platform if the component is to compile error-free.

    Failure to find any of the necessary included files will immediately generate an error in a program built with PiThreads.
There are certain compiler options which must be issued. On the Win32 side, the run time library must be properly configured to handle multi-threaded code. This is accomplished in Microsoft Visual C++ by going to the project settings window and selecting the C/C++ pane. Then select the category code generation and changing the “Use run time library” option to Multithreaded or Debug Multithreaded. On the POSIX side, a program built with PiThreads must be compiled along with two flags, -D_REENTRANT and –lpthread.

Table 1 – OSI_Threads Included Header Files


PiThreads Included Header Files
Module POSIX Win32
File Name Description File Name Description
Thread pthread.h Pthreads API windows.h Win32 API
Class signal.h Handle mid-execution signals process.h Process-related Win32
  unistd.h Standard constants/types    
Critical Uses pthread.h which is included Uses windows.h included with  
Section with the thread class. the thread class.
Class    
Event Uses pthread.h which is included Uses windows.h included with  
Class with the thread class the thread class.
Semaphore sys/types.h System V IPC API Uses windows.h included with
Class sys/ipc.h the thread class
  sys/sem.h