home *** CD-ROM | disk | FTP | other *** search
/ PC Pro 2005 June (DVD) / DPPRO0605DVD.iso / dotNETSDK / SETUP.EXE / netfxsd1.cab / Readme_htm_99________.3643236F_FC70_11D3_A536_0090278A1BB8 < prev    next >
Encoding:
Extensible Markup Language  |  2003-03-28  |  5.7 KB  |  72 lines

  1. ∩╗┐<?xml version="1.0" encoding="utf-8"?><root xmlns:dt="urn:schemas-microsoft-com:datatypes" xmlns:d2="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882"><?xml-stylesheet type="text/xsl" href="..\..\..\readme.xsl"?><HTML><HEAD><TITLE>Thread Static Variables Sample</TITLE><STYLE>
  2.     .Title{FONT-FAMILY: Verdana;FONT-SIZE: large;COLOR: #808080}
  3.     </STYLE><STYLE>
  4.     .Heading{FONT-FAMILY: Verdana;FONT-SIZE: large}
  5.     </STYLE><STYLE>
  6.     .SectionBreak{FONT-SIZE: small;MARGIN-BOTTOM: 2em}
  7.     </STYLE><STYLE>
  8.     .SmallBreak{FONT-SIZE: small;MARGIN-BOTTOM: 1.5em}
  9.     </STYLE><STYLE>
  10.     .Text{FONT-FAMILY: Verdana;FONT-SIZE: x-small}
  11.     </STYLE><STYLE>
  12.     .FixedHeading{FONT-FAMILY: Verdana;FONT-SIZE: x-small}
  13.     </STYLE><STYLE>
  14.     .FixedText{MARGIN-LEFT: 3ex;FONT-FAMILY: Lucida Console;FONT-SIZE: x-small;FONT-WEIGHT: Bold}
  15.     </STYLE><STYLE>
  16.     .ListSansBullets {list-style-type: none;FONT-FAMILY: Verdana;FONT-SIZE: x-small}
  17.     </STYLE></HEAD><BODY><table><tr><td><h2 class="Title">Thread Static Variables Sample</h2></td><td valign="baseline" class="Text">
  18.             ┬á┬á┬á
  19.               
  20.                   (Console Application)
  21.                 </td></tr></table><p class="Text">
  22.     This document contains the release information for the .NET Framework ThreadStaticVariables sample. You will find the following sections below: 
  23.     </p><ul class="Text"><li><a href="#_Sample_Overview">Overview</a></li><li><a href="#_Sample_Topics">Topics</a></li><li><a href="#_Location_of_Sample">Location</a></li><li><a href="#_Building_the_Sample">Building the sample</a></li><li><a href="#_Running_the_Sample">Running the sample</a></li><li><a href="#_sdkvars">Notes</a></li></ul><p class="SectionBreak" /><h4 class="Heading"><a name="_Sample_Overview" />
  24.     Overview
  25.     </h4><p class="Text">
  26. This sample demonstrates how to use the ThreadStaticAttribute type to create static variables backed by thread local storage. Each thread to access the type will receive its own "thread-local" copy of any static variable marked as [ThreadStatic]. 
  27. </p><p class="SectionBreak" /><h4 class="Heading"><a name="_Sample_Topics" />
  28.   Topics
  29.   </h4><p class="Text">
  30.   The following bullets briefly describe the classes and technologies used by this sample.
  31.   </p><ul class="Text"><li><b>Threading - </b><ul class="Text"><li><b>Thread - </b>
  32.          The sample creates two instances of the Thread type and starts each on the same static method. The sample also uses the Join() method to wait for the threads to terminate.
  33.       </li></ul><ul class="Text"><li><b>ThreadStaticAttribute - </b>
  34.          This sample uses the ThreadStaticAttribute to attribute a static member variable. Each thread in the sample then accesses its own copy of the static variable.
  35.       </li></ul></li><li><b>Delegates - </b><ul class="Text"><li><b>ThreadStart - </b>
  36.          The ThreadStart delegate type is used by this sample to create a type-safe callback method for the Thread class to use. 
  37.       </li></ul></li></ul><p class="SectionBreak" /><h4 class="Heading"><a name="_Location_of_Sample" />
  38.     Location
  39.     </h4><p class="Text">
  40.     This sample is located in the <a href="." title="Jump to Folder" target="_blank">Technologies\Threading\ThreadStaticVariables</a> subdirectory of the .NET Framework SDK samples directory.
  41.     </p><p class="FixedHeading">
  42.     For Example:
  43.       <p class="FixedText">
  44.       C:\Program Files\Microsoft.NET\SDK\v1.1\Samples\Technologies\Threading\ThreadStaticVariables</p></p><p class="SectionBreak" /><h4 class="Heading"><a name="_Building_the_Sample" />
  45.     Building the Sample
  46.     </h4><p class="Text">
  47.     In order to properly build and run this sample, the following steps need to be performed.
  48.     </p><p class="Text">
  49.       Type <b>BUILD.bat</b> from the command line.<p class="FixedHeading">
  50.   For Example:
  51.   </p><p class="FixedText">
  52.          C:\Program Files\Microsoft.NET\SDK\v1.1\Samples\Technologies\Threading\ThreadStaticVariables\VB>Build.bat
  53.       </p></p><p class="SectionBreak" /><h4 class="Heading"><a name="_Running_the_Sample" />
  54.     Running the Sample
  55.     </h4><p class="Text">
  56.     In order to run this sample, follow the instructions listed below.
  57.     </p><span class="Text"><ul class="Text"><li>
  58.       Type <b>ThreadStaticVariables.exe</b> from the command line.<p class="FixedHeading">
  59.   For Example:
  60.   </p><p class="FixedText">
  61.          C:\Program Files\Microsoft.NET\SDK\v1.1\Samples\Technologies\Threading\ThreadStaticVariables\VB>ThreadStaticVariables.exe
  62.       </p></li></ul><ul class="Text"><li>
  63.       The output of this example demonstrates two things. First, it shows that each of the three threads is incrementing its own copy of the static variable. This is evident, because there is no logic in the sample to reset the variable value to zero.  Second, it shows that only one thread received a thread-local copy of the variable initialized to a starting value of 10.  This is because only one thread calls the static constructor for the type, which is used to initialize static members.
  64.    </li></ul></span><p class="SectionBreak" /><h4 class="Heading"><a name="_sdkvars" />
  65.     Notes
  66.     </h4><p class="Text">
  67.     For the .Net Framework samples to function properly, your Path, Include, and Lib environment variables must be set correctly. 
  68.     In many cases, the SDK install program updates these environment variables for you. However, if you installed the .Net Framework SDK 
  69.     using Visual Studio .NET, or unselected "register environment variables" during setup, these environment variables will not be updated. 
  70.     You can set the Path, Include and Lib environment variables by running SDKVars.bat, located in the <i><SDKRoot>\Bin</i> directory. 
  71.     SDKVars.bat must be executed in every command shell.
  72.     </p></BODY></HTML></root>