You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

164 lines
6.6 KiB

  1. <!DOCTYPE html
  2. PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  3. <!-- saved from url=(0014)about:internet -->
  4. <html xmlns:MSHelp="http://www.microsoft.com/MSHelp/" lang="en-us" xml:lang="en-us"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  5. <meta name="DC.Type" content="topic">
  6. <meta name="DC.Title" content="Intel&reg; Threading Building Blocks Benefits">
  7. <meta name="DC.subject" content="Benefits">
  8. <meta name="keywords" content="Benefits">
  9. <meta name="DC.Relation" scheme="URI" content="../main/title.htm">
  10. <meta name="DC.Format" content="XHTML">
  11. <meta name="DC.Identifier" content="tutorial_Benefits">
  12. <link rel="stylesheet" type="text/css" href="../intel_css_styles.css">
  13. <title>Intel&reg; Threading Building Blocks Benefits</title>
  14. <xml>
  15. <MSHelp:Attr Name="DocSet" Value="Intel"></MSHelp:Attr>
  16. <MSHelp:Attr Name="Locale" Value="kbEnglish"></MSHelp:Attr>
  17. <MSHelp:Attr Name="TopicType" Value="kbReference"></MSHelp:Attr>
  18. </xml>
  19. </head>
  20. <body id="tutorial_Benefits">
  21. <!-- ==============(Start:NavScript)================= -->
  22. <script src="..\NavScript.js" language="JavaScript1.2" type="text/javascript"></script>
  23. <script language="JavaScript1.2" type="text/javascript">WriteNavLink(1);</script>
  24. <!-- ==============(End:NavScript)================= -->
  25. <a name="tutorial_Benefits"><!-- --></a>
  26. <h1 class="topictitle1">Intel&reg; Threading Building Blocks Benefits</h1>
  27. <div>
  28. <p> Intel&reg; Threading Building Blocks (Intel&reg; TBB) is a library that helps
  29. you leverage multi-core performance without having to be a threading expert.
  30. Typically you can improve performance for multi-core processors by implementing
  31. the key points explained in the early sections of the User Guide. As your
  32. expertise grows, you may want to dive into more complex subjects that are
  33. covered in advanced sections.
  34. </p>
  35. <p>There are a variety of approaches to parallel programming, ranging from
  36. using platform-dependent threading primitives to exotic new languages. The
  37. advantage of Intel&reg; Threading Building Blocks is that it works at a higher
  38. level than raw threads, yet does not require exotic languages or compilers. You
  39. can use it with any compiler supporting ISO C++. The library differs from
  40. typical threading packages in the following ways:
  41. </p>
  42. <ul type="disc">
  43. <li>
  44. <p><strong>Intel&reg; Threading Building Blocks enables you to specify
  45. <em>logical paralleism</em> instead of threads</strong>. Most threading
  46. packages require you to specify threads. Programming directly in terms of
  47. threads can be tedious and lead to inefficient programs, because threads are
  48. low-level, heavy constructs that are close to the hardware. Direct programming
  49. with threads forces you to efficiently map logical tasks onto threads. In
  50. contrast, the Intel&reg; Threading Building Blocks run-time library automatically
  51. maps logical parallelism onto threads in a way that makes efficient use of
  52. processor resources.
  53. </p>
  54. </li>
  55. <li>
  56. <p><strong>Intel&reg; Threading Building Blocks targets
  57. <em>threading for performance</em></strong>. Most general-purpose
  58. threading packages support many different kinds of threading, such as threading
  59. for asynchronous events in graphical user interfaces. As a result,
  60. general-purpose packages tend to be low-level tools that provide a foundation,
  61. not a solution. Instead, Intel&reg; Threading Building Blocks focuses on the
  62. particular goal of parallelizing computationally intensive work, delivering
  63. higher-level, simpler solutions.
  64. </p>
  65. </li>
  66. <li>
  67. <p><strong>Intel&reg; Threading Building Blocks is
  68. <em>compatible</em> with other threading packages.</strong> Because the
  69. library is not designed to address all threading problems, it can coexist
  70. seamlessly with other threading packages.
  71. </p>
  72. </li>
  73. <li>
  74. <p><strong>Intel&reg; Threading Building Blocks emphasizes
  75. <em>scalable, data parallel programming</em></strong>. Breaking a program
  76. up into separate functional blocks, and assigning a separate thread to each
  77. block is a solution that typically does not scale well since typically the
  78. number of functional blocks is fixed. In contrast, Intel&reg; Threading Building
  79. Blocks emphasizes
  80. <em>data-parallel</em> programming, enabling multiple threads to work
  81. on different parts of a collection. Data-parallel programming scales well to
  82. larger numbers of processors by dividing the collection into smaller pieces.
  83. With data-parallel programming, program performance increases as you add
  84. processors.
  85. </p>
  86. </li>
  87. <li>
  88. <p><strong>Intel&reg; Threading Building Blocks relies on
  89. <em>generic programming</em></strong>. Traditional libraries specify
  90. interfaces in terms of specific types or base classes. Instead, Intel&reg;
  91. Threading Building Blocks uses generic programming. The essence of generic
  92. programming is writing the best possible algorithms with the fewest
  93. constraints. The C++ Standard Template Library (STL) is a good example of
  94. generic programming in which the interfaces are specified by
  95. <em>requirements</em> on types. For example, C++ STL has a template
  96. function
  97. <samp class="codeph">sort</samp> that sorts a sequence abstractly defined in
  98. terms of iterators on the sequence. The requirements on the iterators are:
  99. </p>
  100. <ul type="disc">
  101. <li>
  102. <p>Provide random access
  103. </p>
  104. </li>
  105. <li>
  106. <p>The expression
  107. <samp class="codeph">*i&lt;*j</samp> is true if the item pointed to by
  108. iterator
  109. <samp class="codeph">i</samp> should precede the item pointed to by iterator
  110. <samp class="codeph">j</samp>, and false otherwise.
  111. </p>
  112. </li>
  113. <li>
  114. <p>The expression
  115. <samp class="codeph">swap(*i,*j)</samp> swaps two elements.
  116. </p>
  117. </li>
  118. </ul>
  119. </li>
  120. </ul>
  121. <p>Specification in terms of requirements on types enables the template to
  122. sort many different representations of sequences, such as vectors and deques.
  123. Similarly, the Intel&reg; Threading Building Blocks templates specify requirements
  124. on types, not particular types, and thus adapt to different data
  125. representations. Generic programming enables Intel&reg; Threading Building Blocks
  126. to deliver high performance algorithms with broad applicability.
  127. </p>
  128. </div>
  129. <div class="familylinks">
  130. <div class="parentlink"><strong>Parent topic:</strong>&nbsp;<a href="../main/title.htm">Intel&reg; Threading Building Blocks Documentation</a></div>
  131. </div>
  132. <div></div>
  133. </body>
  134. </html>