KEMBAR78
NI Tutorial 6098 | PDF | Parallel Computing | Thread (Computing)
0% found this document useful (0 votes)
33 views1 page

NI Tutorial 6098

Dataflow programming languages are ideal for programming parallel hardware. Dataflow programming models contrast to the control flow model implemented in languages such as C. LabVIEW recognizes that it can execute the two loops independently, and in a multiprocessing or hyperthreaded environment, often simultaneously.

Uploaded by

Nelly Salazar
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
33 views1 page

NI Tutorial 6098

Dataflow programming languages are ideal for programming parallel hardware. Dataflow programming models contrast to the control flow model implemented in languages such as C. LabVIEW recognizes that it can execute the two loops independently, and in a multiprocessing or hyperthreaded environment, often simultaneously.

Uploaded by

Nelly Salazar
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Document Type:Tutorial NI Supported:Yes Publish Date:Nov1,2007

Why Dataflow Programming Languages are Ideal for Programming Parallel Hardware
Overview This document is part of the

Multicore Programming Fundamentals Whitepaper Series


MulticoreProgrammingFundamentalsWhitepaperSeries

Viewthiswhitepapertolearnaboutdataflowprogramminglanguagesandwhytheyareanidealchoiceforprogrammingparallelhardware. Table of Contents 1.DataflowProgrammingOverview 2.ExampleofCreatingaParallelTaskinLabVIEW 3.MoreResourcesonMulticoreProgramming Dataflow Programming Overview DataflowprogrammingmodelscontrasttothecontrolflowmodelimplementedinlanguagessuchasC. Becauseofthetop-downsequentialprogrammingapproach,applicationswritteninChaveinherentlimitationswhenmappingtoparallelhardware.Incontrast,withadataflowmodel,nodesona blockdiagramareconnectedtooneanothertoexpressthelogicalexecutionflow,andtheycanbeusedtoeasilyexpressparallelism.Whenablockdiagramnodereceivesallrequiredinputs,it producesoutputdataandpassesthatdatatothenextnodeinthedataflowpath.Themovementofdatathroughthenodesdeterminestheexecutionorderofthefunctionsontheblockdiagram. Example of Creating a Parallel Task in LabVIEW TaskparallelismisoftencreatedinherentlywhenwritingaprograminLabVIEW.ThefollowingexampletakesadvantageoftheLabVIEWmultithreadedexecutionsystem.Thisexamplehastwo paralleltasks,onetaskisanevent-drivenUItask,andtheotherperformsanacquisitionfromaperipheraldevice.LabVIEWrecognizesthatitcanexecutethetwoloopsindependently,andina multiprocessingorhyperthreadedenvironment,oftensimultaneously.

Figure1-ImplicitParallelisminLabVIEW Noticethatthesetheaboveexampledoesnotincludecodeforexplicitthreadmanagement.TheLabVIEWdataflowprogrammingparadigmallowstheLabVIEWexecutionsystemtorunthetwo loopsindifferentthreads.Inmanytext-basedprogramminglanguages,youmustexplicitlycreateandhandlethreads. LabVIEWalsooffersspecialstructuresthatwillmapcodetoparallelhardwareresourcesforexplicitthreading.Forexample,onesuchstructureistheTimedLoop.Whencodethatiscontainedina TimedLoopisrunonadual-coreormulticoresystem,auniquethreadwillbecreated.Figure1belowdemonstrateshowtwoTimedLoopswillcreatetwouniquethreadswhichcanbebalanced acrosstwoseparatecoresofamulticoresystem.

Figure2-ExplicitParallelisminLabVIEW InthecaseofFPGAs,theconceptofthreadingdoesnotexist,soloopstructuresinsteadreservereal-estateonthefabricoftheFPGAandexecuteasauniqueprocessorcores. Insummary,sincedataflowprogramminglanguagesareinherentlyparallelinnature,developerscancreateapplicationsthatareimplicitlyparallel.Thischaracteristicofaprogramminglanguage signifiesthatdevelopersdon'tneedtobeexpertsinthelow-levelintricaciesofparallelhardwaresuchasmulticoreprocessorsandFPGAsinordertoreaptheperformancebenefits--thelanguage itselfhelpsparallelizethecode. More Resources on Multicore Programming MulticoreProgrammingFundamentalsWhitepaperSeries

www.ni.com/multicore OvercomingMulticoreProgrammingChallengeswithLabVIEW DifferencesbetweenMultithreadingandMultitasking UnderstandingParallelHardware:Multiprocessors,Hyperthreading,Dual-Core,MulticoreandFPGAs Legal Thistutorial(this"tutorial")wasdevelopedbyNationalInstruments("NI").AlthoughtechnicalsupportofthistutorialmaybemadeavailablebyNationalInstruments,thecontentinthistutorialmay notbecompletelytestedandverified,andNIdoesnotguaranteeitsqualityinanywayorthatNIwillcontinuetosupportthiscontentwitheachnewrevisionofrelatedproductsanddrivers.THIS TUTORIALISPROVIDED"ASIS"WITHOUTWARRANTYOFANYKINDANDSUBJECTTOCERTAINRESTRICTIONSASMORESPECIFICALLYSETFORTHINNI.COM'STERMSOFUSE( http://ni.com/legal/termsofuse/unitedstates/us/).

1/1

www.ni.com

You might also like