This chapter discusses using multithreading to improve LabVIEW applications’performance. Multithreading is an advanced programming topic, and its use requiresthe programmer to posses a fundamental understanding of this technology. Lab-VIEW provides two significant advantages to the programmer when working withmultitasking and multithreading. The first advantage is the complete abstraction ofthe threads themselves. LabVIEW programmers never create, destroy, or synchronizethreads. The second advantage is the dataflow model used by LabVIEW. This modelprovides G a distinct advantage over its textual language counterparts because itsimplifies a programmer’s perception of multitasking. The fundamental concept ofmultitasking can be difficult to grasp with text-based languages.Multithreading adds a new dimension to software engineering. Applications canperform multiple tasks somewhat simultaneously. A good example of an applicationthat has added multithreading is Microsoft Word for Windows 95 (Version 7.0).Word for Windows 95 uses multithreading to perform spell-checking and grammarvalidation. The threads added to perform this task allow the application to performthese tasks while the user is typing. The previous version, Word 6.0 for Windows3.1, cannot do this because it runs only one task at a time; a user would have tostop typing and selectCheck Spelling. The first six sections of this chapter providethe basic knowledge of multithreading. This discussion focuses on definitions, multitaskingmechanics, multithreading specific problems, and information on variousthread-capable operating systems.A brief section on multithreading myths is presented. The impact of multithreadingon applications is misunderstood by a number of programmers. Section 9.6explains precisely what the benefits of multithreading are. Many readers will besurprised to learn that multithreading does little to increase the speed of an application.Multi-threading does provide the illusion that sections of an application runfaster.The last three sections of this chapter are devoted to the effective use of multithreadingin LabVIEW. A strategy to estimate the maximum number of useful threadswill be presented. The focal point of this chapter is using subroutine VIs to maximizeapplication performance. The use of threads adds a new dimension of benefits toboth subroutine VIs and DLLs.
猜您喜欢
推荐内容
开源项目推荐 更多
热门活动
热门器件
用户搜过
随便看看
热门下载
热门文章
热门标签
评论