9.1.2 UNIX................................................................................................398
9.1.3 Multitasking .....................................................................................398
9.1.3.1 Preemptive Multithreading ...............................................399
9.1.4 Kernel Objects.................................................................................. 400
9.1.5 Thread............................................................................................... 400
9.1.6 Process..............................................................................................401
9.1.7 Application .......................................................................................401
9.1.8 Priority..............................................................................................402
9.1.8.1 How Operating Systems Determine which Threads........402
9.1.9 Security.............................................................................................402
9.1.10 Thread Safe ......................................................................................402
9.2 Thread Mechanics ........................................................................................403
9.2.1 Thread States....................................................................................404
9.2.2 Scheduling Threads..........................................................................404
9.2.3 Context Switching............................................................................404
9.3 Win32 Multithreading..................................................................................405
9.4 Pthreads ........................................................................................................406
9.5 Multithreading Problems..............................................................................407
9.5.1 Race Conditions ...............................................................................408
9.5.2 Priority Inversion..............................................................................408
9.5.3 Starvation..........................................................................................409
9.5.4 Deadlocking .....................................................................................409
9.5.5 Operating System Solutions.............................................................410
9.6 Multithreading Myths ..................................................................................410
9.6.1 The More Threads, the Merrier .......................................................410
9.6.2 More Threads, More Speed .............................................................411
9.6.3 Makes Applications More Robust ...................................................411
9.6.4 Conclusion on Myths.......................................................................412
9.7 Hyper-Threading ..........................................................................................412
9.8 Multithreaded LabVIEW .............................................................................413
9.8.1 Execution Subsystems......................................................................414
9.8.2 The Run Queue ................................................................................417
9.8.3 DLLs in Multithreaded LabVIEW .................................................. 418
9.8.4 Customizing the Thread Configuration ...........................................421
9.9 Thread Count Estimation for LabVIEW .....................................................423
9.9.1 Same as Caller or Single Subsystem Applications .........................426
9.9.2 Multiple Subsystem Applications ....................................................427
9.9.3 Optimizing VIs for Threading .........................................................428
9.9.4 Using VI Priorities ...........................................................................432
9.10 Subroutines in LabVIEW.............................................................................434
9.10.1 Express VIs ......................................................................................435
9.10.2 LabVIEW Data Types......................................................................435
9.10.3 When to Use Subroutines ................................................................437
9.11 Summary ......................................................................................................441
Bibliography .......................................................................................................... 441
3325_book.fm Page xvii Monday, August 21, 2006 2:07 PM