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.

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