Tài liệu Module 14 (Optional): Threading and Asynchronous Programming pptx

118 365 0
Tài liệu Module 14 (Optional): Threading and Asynchronous Programming pptx

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

Thông tin tài liệu

Contents Module 14 (Optional): Threading and Asynchronous Programming Overview Introduction to Threading Using Threads in NET Thread Safety 29 Special Thread Topics 51 Asynchronous Programming in NET 74 Lab 14: Working With Multithreaded Applications 92 Review 108 Information in this document, including URL and other Internet Web site references, is subject to change without notice Unless otherwise noted, the example companies, organizations, products, domain names, e-mail addresses, logos, people, places, and events depicted herein are fictitious, and no association with any real company, organization, product, domain name, e-mail address, logo, person, places or events is intended or should be inferred Complying with all applicable copyright laws is the responsibility of the user Without limiting the rights under copyright, no part of this document may be reproduced, stored in or introduced into a retrieval system, or transmitted in any form or by any means (electronic, mechanical, photocopying, recording, or otherwise), or for any purpose, without the express written permission of Microsoft Corporation Microsoft may have patents, patent applications, trademarks, copyrights, or other intellectual property rights covering subject matter in this document Except as expressly provided in any written license agreement from Microsoft, the furnishing of this document does not give you any license to these patents, trademarks, copyrights, or other intellectual property  2001-2002 Microsoft Corporation All rights reserved Microsoft, ActiveX, BizTalk, IntelliMirror, Jscript, MSDN, MS-DOS, MSN, PowerPoint, Visual Basic, Visual C++, Visual C#, Visual Studio, Win32, Windows, Windows Media, and Window NT are either registered trademarks or trademarks of Microsoft Corporation in the U.S.A and/or other countries The names of actual companies and products mentioned herein may be the trademarks of their respective owners Module 14 (Optional): Threading and Asynchronous Programming Instructor Notes Module 14 Presentation: 150 Minutes Lab: 60 Minutes This module provides students with knowledge about the support that the Microsoft® NET Framework provides for working with multithreaded applications and asynchronous programming After completing this module, students will be able to: ! Create and manage threads ! Create thread-safe code ! Create and use timers ! Create threads using thread pools ! Create managed threads that interact well with COM components ! Create Microsoft Windows® Forms applications with background threads ! Make asynchronous calls using delegates Materials and Preparation This section provides the materials and preparation tasks that you need to teach this module Required Materials To teach this module, you need the Microsoft PowerPoint® file 2349B_14.ppt Preparation Tasks To prepare for this module: ! Read all of the materials for this module ! Practice the demonstrations ! Complete the lab iii iv Module 14 (Optional): Threading and Asynchronous Programming Demonstrations This section provides demonstration procedures that will not fit in the margin notes or are not appropriate for the student notes The code for each of the following demonstrations is contained in project folders that are located in \Democode\Mod14 Use the debugger to step through the code while you point out features and ask students what they think will happen next Managing Threads In this demonstration, you will show students how to create and manage threads in the NET Framework by using some of the classes and methods that were covered in Using Threads in NET The code for this demonstration is contained in one project and is located in \Democode\Mod14\Demo14.1 Interrupt and Abort In this demonstration, you will show students how to terminate threads by using the Thread.Interrupt and Thread.Abort methods The code for this demonstration is contained in one project and is located in \Democode\Mod14\Demo14.2 Using Synchronization Contexts and Synchronized Code Regions to Provide Thread Safety In this demonstration, you will use a series of tests to show students how to achieve thread safety through the use of synchronization contexts and synchronized code regions The code for this demonstration is contained in one project and is located in \Democode\Mod14\Demo14.3 Using Synchronization Techniques and Thread Pooling In this demonstration, you will show students how to perform synchronization by using the C# lock keyword and manual synchronization primitives, and also how to obtain multiple threads by using a thread pool The code for this demonstration is contained in one project and is located in \Democode\Mod14\Demo14.4 Module 14 (Optional): Threading and Asynchronous Programming Windows Forms Threading In this demonstration, you will show students how to use a background thread in a Windows Forms application The code for this demonstration is contained in one project and is located in \Democode\Mod14\Demo14.5 Asynchronous File Stream Read In this demonstration, you will show students how to use synchronous and asynchronous read methods on a file stream For the asynchronous case, you will show four different ways to complete the operation: callback, poll, end method call, and wait with timeout The code for this demonstration is contained in one project and is located in \Democode\Mod14\Demo14.6 Using a Delegate In this demonstration, you will show students how to use a delegate object to make asynchronous calls The code for this demonstration is contained in one project and is located in \Democode\Mod14\Demo14.7 Multimedia Presentation This section lists the multimedia items that are part of this module Instructions for launching and playing the multimedia are included with the relevant slides Asynchronous Programming This animation illustrates the NET Framework common language runtime support for asynchronous programming using Delegate objects v vi Module 14 (Optional): Threading and Asynchronous Programming Module Strategy Use the following strategy to present this module: ! Introduction to Threading Provide a general introduction to the concept of threads and discuss advantages and disadvantages of using them As a simple illustration of the concept of threading, use Microsoft Internet Explorer to show how you can still work while waiting for a download operation to complete Provide a high level overview of the System.Threading namespace and introduce the asynchronous design pattern, which you will cover in more detail in Asynchronous Programming in NET Explain how application domains play a key role in NET threading architecture ! Using Threads in NET Focus on the classes in the System.Threading namespace that are used to start, manage, and terminate threads In addition to the preceding operations, discuss the role of managed thread local storage ! Thread Safety Focus on the issues that students may encounter in multithreaded programming from sharing data and resources between threads, as a result of thread synchronization Introduce strategies that the NET Framework provides for dealing with synchronization, in particular classes and interfaces in System.Threading ! Special Thread Topics Introduce the Thread.Timer class, which provides a mechanism for executing methods at specified intervals Explain how a TimerCallback delegate is used in conjunction with a Timer Discuss the use of thread pools in making multiple threads operate more efficiently Discuss how managed threads call into a COM object Outline best practices for implementing thread-safe code Module 14 (Optional): Threading and Asynchronous Programming ! vii Asynchronous Programming in NET Provide a brief definition of the concept of asynchronous programming as the ability to issue method calls to other components, and to carry on with other work without waiting for the operation to complete Introduce the asynchronous design pattern, and emphasize that one of its innovations is that the caller can decide whether a particular call should be asynchronous Spend most of the time in this section on the Asynchronous File Stream Read Example In addition to the code on the slides and information in the Student Notes, there is an accompanying demonstration Discuss the use of Asynchronous delegates to call a synchronous method in an asynchronous manner Play the Asynchronous Programming animation to illustrate the NET Framework common language runtime support for asynchronous programming using Delegate objects Module 14 (Optional): Threading and Asynchronous Programming Overview Topic Objective To provide an overview of the module topics and objectives ! ! Thread Safety ! Special Thread Topics ! In this module, you will learn about the support that the NET Framework provides for working with multithreaded applications and asynchronous programming Using Threads in NET ! Lead-in Introduction to Threading Asynchronous Programming in NET *****************************ILLEGAL FOR NON-TRAINER USE****************************** In this module, you will learn about the support that the Microsoft® NET Framework provides for working with multithreaded applications and asynchronous programming The common language runtime abstracts much of the threading support into classes that greatly simplify most threading tasks Even if you not create your own threads explicitly, you need to understand how your code should handle multiple threads if it is run in a multithreaded environment You will also learn how to handle thread synchronization to maintain application responsiveness and avoid potential data corruption and other problems In the NET Framework, asynchronous programming is a feature that is supported by Remoting, Networking: HTTP, TCP, File I/O, ASP.NET, and Microsoft Message Queue Server (MSMQ) Because asynchronous programming is a core concept, the NET Framework provides a common design pattern for handling asynchronous execution This module introduces the NET Framework asynchronous Design Pattern and gives examples of its use After completing this module, you will be able to: ! Create and manage threads ! Create thread-safe code ! Create and use timers ! Create threads using thread pools ! Create managed threads that interact well with COM components ! Create Microsoft Windows® Forms applications with background threads ! Make asynchronous calls using delegates Module 14 (Optional): Threading and Asynchronous Programming " Introduction to Threading Topic Objective To provide an overview of the topics that you will cover in this section Lead-in In this section, you will learn about the advantages and disadvantages of using threads and the support for threads that is provided by the NET Framework ! Overview of Threads ! Overview of Support for Threading in NET ! Thread Architecture in NET *****************************ILLEGAL FOR NON-TRAINER USE****************************** In this section, you will learn about the advantages and disadvantages of using threads and the support for threads that is provided by the NET Framework 96 Module 14 (Optional): Threading and Asynchronous Programming ! Implement the WriteLog method In Form1.cs, locate the following comment for the WriteLog method of the MyLogger class: // TODO - Exercise 1.3: Add code to write to logger Use a lock statement to ensure that only one thread at a time executes the static method’s code Place the remainder of the WriteLog method’s code within the lock statement block Create a variable of type int that is named writeCount and initialize it to the value of numberOfWrites Create a conditional expression that evaluates whether the logger is running If the logger is not running, throw an InvalidOperationException exception If the logger is running (loggerRunning is true): a Make the thread sleep for seconds b Increment the value of writeCount by c Write to the stream by using the following format and supplying writeCount and logText as the parameters: "\nCount: {0} Text: {1} - Time:" d Write to the stream by using the following format and supplying the current time and date as the parameters: "{0} {1} \n\n" e Flush the stream f Set numberOfWrites to the value of writeCount Return writeCount Module 14 (Optional): Threading and Asynchronous Programming 97 ! Test the application Build and run the application by using Visual Studio NET Ignore warning messages about fields that are never used In the Text To Log field, type Hello World To check the error reporting, click Synchronous Write, and note the following message in the status bar at the bottom of the form: “Invalid Operation - Write failed because logger was stopped” Click Start Logger, and note the Logger State Indicator progress bar and the following message in the status bar: “Logger started” Click Synchronous Write, and note that after a pause of seconds the following message is displayed in the status bar: “Log written, count = 1” Click Synchronous Write, and note that after a pause of seconds the following message is displayed in the status bar: “Log written, count = 2” Click Stop Logger, and note that the message in the status bar now says: “Logger stopped” Use Visual Studio NET to view the log file Log.txt, that was created in the same folder as the multithreading application’s executable program: \Labs\Lab14\Starter\Multithreading\bin\Debug You should see output that is similar to the following: StartLogger - Time: 11:09:48 AM Wednesday, September 19, 2001 Count:1 Text: Hello World - Time:11:10:40 AM Wednesday, September 19, 2001 Count:2 Text: Hello World - Time:11:11:30 AM Wednesday, September 19, 2001 StopLogger - Time:11:11:56 AM Wednesday, September 19, 2001 Stop the application and delete Log.txt 98 Module 14 (Optional): Threading and Asynchronous Programming Exercise Periodically Writing to a Log File In this exercise, you will add code to the MyLogger class to use a System.Thread.Timer object This object is used to periodically write a message to the log file indicating that the logger is alive when the logger is running ! Create the Timer object In Form1.cs, locate the following comment for the StartLogger method of the MyLogger class: // TODO - Exercise 2.1: Add code to periodically call ! a method using a System.Threading.Timer object Locate the line of code that sets loggerRunning to true, and after this line assign to the static member variable timer a new object of type System.Threading.Timer The new object should call the MyLogger class’s LogStatus method every seconds LogStatus is a static method whose delegate type is TimerCallback ! Dispose of the Timer object In Form1.cs, locate the following comment for the StopLogger method of the MyLogger class: // TODO - Exercise 2.2: Add code to dispose of the! System.Threading.Timer object Locate the line of code that writes the string "\nStopLogger - Time:" to the log file and before this line add code that invokes the Dispose method on the timer object ! Add the Timer object that writes logger alive messages periodically to the log file In Form1.cs, locate the following comment for the LogStatus method of the MyLogger class: // TODO - Exercise 2.3: Add Timer callback method code to! write the date and time to the log Write to the stream the following string: "\nLogger Alive: " Once again, write to the stream by using the following format and supplying the current time and date as the parameters: "{0} {1} \n\n" Module 14 (Optional): Threading and Asynchronous Programming 99 ! Test the application Build and run the application by using Visual Studio NET Ignore warning messages about fields that are never used Ensure that you have deleted the file Log.txt that was created in the preceding exercise In the Text To Log field, type Hello World Click Start Logger, and note the following message in the status bar: “Logger started” Click Synchronous Write, and note that after a pause of seconds the following message is displayed in the status bar: “Log written, count = 1” Click Synchronous Write, and note that after a pause of seconds the message in the status bar changes to: “Log written, count = 2” Click the Stop Logger button and note that the message in the status bar now says; “Logger stopped” Use Visual Studio NET to view the file Log.txt that was created in the same folder as the multithreading application’s executable program: \Labs\Lab14\Starter\Multithreading\bin\Debug You should see output that is similar to the following: StartLogger - Time: 11:47:21 AM Wednesday, September 19, 2001 Logger Alive: 11:47:21 AM Wednesday, September 19, 2001 Count:1 Text: Hello World - Time:11:47:24 AM Wednesday, September 19, 2001 Logger Alive: 11:47:26 AM Wednesday, September 19, 2001 Count:2 Text: Hello World - Time:11:47:27 AM Wednesday, September 19, 2001 StopLogger - Time:11:47:28 AM Wednesday, September 19, 2001 Stop the application and delete Log.txt 100 Module 14 (Optional): Threading and Asynchronous Programming Exercise Providing the User with Status In this exercise, you will add code to the MyLogger class to use a background thread that periodically advances the Progress Bar in the user interface whenever the logger is running ! Create the background thread In Form1.cs, locate the following comment for the StartLogger method of the MyLogger class: // TODO - Exercise 3.1: Add code to start a background! thread Locate the line of code that assigns to the static member variable timer a new object of type System.Threading.Timer and after this line, add code to the following steps Create a new object of type Thread The Thread object is initialized with a delegate object of type ThreadStart that refers to the ThreadProc method of the MyLogger class This new object should be assigned to the existing static member variable timerThread Make timerThread a background thread by using its IsBackground property Start the timerThread background thread ! Interrupt the background thread In Form1.cs, locate the following comment for the StopLogger method of the MyLogger class: // TODO - Exercise 3.2: Add code to stop a background! thread Locate the line of code that invokes the Dispose method on the timer object and before this line, set up a conditional expression that checks whether the background thread is not null If the background thread named timerThread is not null: a Call the timerThread Interrupt method b Assign timerThread, form, and mi to null Module 14 (Optional): Threading and Asynchronous Programming 101 ! Advance the form’s progress bar periodically In Form1.cs, locate the following comment for the ThreadProc method of the MyLogger class: // TODO - Exercise 3.3: Add code to update the client's! progress indicator In a try/catch block’s try section, insert a while(true) statement whose block contains the following steps: a Call the form object’s BeginInvoke method Pass as the BeginInvoke method’s parameter the delegate object of type MethodInvoker that refers to the form object’s UpdateProgress method This object was created in the StartLogger method and is named mi b Make the thread sleep for ½ second In the try/catch block’s catch section add code to the following: a Catch exceptions of the type ThreadInterruptedException b Within the catch block, nothing This will resolve the exception and the thread will terminate gracefully ! Test the application Build and run the application by using Visual Studio NET Ensure that you have deleted the file Log.txt that was created in the preceding exercise In the Text To Log field, type Hello World Click Start Logger Note that the Logger State Indicator progress bar is advancing and note the following message in the status bar “Logger started” Click Synchronous Write, and note that the progress bar stops advancing After a pause of seconds, the progress bar jumps ahead and the following message is displayed in the status bar “Log written, count = 1” Click Synchronous Write, and note that the progress bar stops advancing After a pause of seconds, the progress bar jumps ahead and the following message is displayed in the status bar “Log written, count = 2” Click Stop Logger Note that the Logger State Indicator progress bar has stopped advancing and note that the message in the status bar now says: “Logger stopped” 102 Module 14 (Optional): Threading and Asynchronous Programming Use Visual Studio NET to view the file Log.txt that was created in the same folder as the multithreading application’s executable program: \Labs\Lab14\Starter\Multithreading\bin\Debug You should see output that is similar to the following: StartLogger - Time: 11:56:44 AM Wednesday, September 19, 2001 Logger Alive: 11:56:44 AM Wednesday, September 19, 2001 Count:1 Text: Hello World - Time:11:56:47 AM Wednesday, September 19, 2001 Logger Alive: 11:56:49 AM Wednesday, September 19, 2001 Count:2 Text: Hello World - Time:11:56:50 AM Wednesday, September 19, 2001 StopLogger - Time:11:56:53 AM Wednesday, September 19, 2001 Stop the application and delete the Log.txt Module 14 (Optional): Threading and Asynchronous Programming 103 Exercise Making an Asynchronous Method Call In this exercise, you will add code that uses a delegate object to begin an asynchronous invocation of the WriteLog method of the MyLogger class The code will specify a method to be called when the WriteLog method completes You will add code to this method to obtain the results of the WriteLog method and post the results to the form’s status bar ! Create the event handler code that initiates the asynchronous write In Form1.cs, locate the following comment for the button4_Click method of the Form1 class: // TODO - Exercise 4.1: Add code to begin asynchronous! log write Set the statusBar1.Text property to an empty string Create a delegate named wld of type WriteLogDelegate that refers to the WriteLog static method of the MyLogger class Create a delegate object named cb of type AsyncCallback that refers to the current Form1 object’s AsynchronousWriteResults method Initialize a variable named ar of type IAsyncResult to the value that is returned by invoking the wld object’s BeginInvoke method BeginInvoke should include the following three parameters: a The textBox2 Text property b The cb delegate object c null 104 Module 14 (Optional): Threading and Asynchronous Programming ! Create the code that is called when the asynchronous method call completes In Form1.cs, locate the following comment for the AsynchronousWriteResults method of the Form1 class: // TODO - Exercise 4.2: Add code to this callback method to handle ! the results of asynchronous log write Create a delegate object name wld of type WriteLogDelegate and set wld to refer to the method that was previously specified in the button4_Click method’s BeginInvoke method call by doing the following: a Explicitly cast the parameter that is named ar of type IAsyncResult to type AsyncResult and get its AsyncDelegate property b Explicitly cast the result of the preceding step to type WriteLogDelegate and assign this value to wld Create a try/catch block and in the try section, add code to the following: a Initialize a variable named count of type int to the result of calling the wld object’s EndInvoke method with the single parameter named ar b Assign to the existing variable named resultString of type string the following value: "Log written asynchronously, " + count.ToString() In the try/catch block’s catch section, add code to the following: a Catch exceptions of the type InvalidOperationException b Assign to the existing variable named resultString of type string the following value: "Invalid Operation - Asynchronous write failed because ! logger was stopped" To update the form’s control on the thread that originally created the control, call the BeginInvoke method of the current Form1 object BeginInvoke takes a single parameter that is a delegate of type MethodInvoker that refers to the current Form1 object’s UpdateAsynchronousWriteStatus method ! Test the application Build and run the application by using Visual Studio NET Ensure that you have deleted the file Log.txt that was created in the preceding exercise In the Text To Log field, type Hello Asynchronous World Click Start Logger Note that the Logger State Indicator progress bar is advancing and note the following message in the status bar “Logger started” Module 14 (Optional): Threading and Asynchronous Programming 105 Click Asynchronous Write, and note that the progress bar continues to advance After a pause of seconds, the following message is displayed in the status bar: “Log written asynchronously, 1” Click Asynchronous Write, and note that after a pause of seconds the message in the status bar changes to: “Log written asynchronously, 2” Click Asynchronous Write twice in quick succession, and after the message “Log written asynchronously, 4” is displayed in the status bar Click Stop Logger Note that the Logger State Indicator progress bar stops advancing and note that the following message is displayed in the status bar: “Logger stopped” Use Visual Studio NET to view the file Log.txt that was created in the same folder as the multithreading application’s executable program: \Labs\Lab14\Starter\Multithreading\bin\Debug You should see output that is similar to the following: StartLogger - Time: 12:04:27 PM Wednesday, September 19, 2001 Logger Alive: 12:04:27 PM Wednesday, September 19, 2001 Count:1 Text: Hello Asynchronous World - Time:12:04:30 PM Wednesday, September 19, 2001 Logger Alive: 12:04:32 PM Wednesday, September 19, 2001 Count:2 Text: Hello Asynchronous World - Time:12:04:33 PM Wednesday, September 19, 2001 Count:3 Text: Hello Asynchronous World - Time:12:04:36 PM Wednesday, September 19, 2001 Logger Alive: 12:04:37 PM Wednesday, September 19, 2001 Count:4 Text: Hello Asynchronous World - Time:12:04:38 PM Wednesday, September 19, 2001 StopLogger - Time:12:04:41 PM Wednesday, September 19, 2001 Stop the application and delete Log.txt 106 Module 14 (Optional): Threading and Asynchronous Programming If Time Permits Demonstrating a Race Condition In this exercise, you will remove the lock in the WriteLog method of the MyLogger class You will note the errors resulting from the existence of a race condition that occurs when multiple asynchronous calls cause multiple threads to concurrently access the static variables of the MyLogger class ! Create the potential for a race condition by removing the WriteLog method lock In Form1.cs, locate the WriteLog method of the MyLogger class and comment out the line(s) that contain the lock statement and the opening brace of the lock statement block Just before the end of the method, comment out the closing brace of the lock statement ! Test the application Build and run the application by using Visual Studio NET Ensure that you have deleted the file Log.txt that was created in the preceding exercise In the Text To Log field, type Hello Asynchronous World Click Start Logger Note that the Logger State Indicator progress bar is advancing and note the following message in the status bar: “Logger started” Click Asynchronous Write, and note that the progress bar continues to advance After a pause of seconds, the following message is displayed in the status bar: “Log written asynchronously, 1” Click Asynchronous Write, and note that after a pause of seconds the message in the status bar changes to: “Log written asynchronously, 2” Click Asynchronous Write twice in quick succession, wait for about 10 seconds, and then click Stop Logger Note that the Logger State Indicator progress bar stops advancing and note the following message is displayed in the status bar: “Logger stopped” Module 14 (Optional): Threading and Asynchronous Programming 107 Use Visual Studio NET to view the file Log.txt that was created in the same folder as the multithreading application’s executable program: \Labs\Lab14\Starter\Multithreading\bin\Debug You should see output that is similar to the following: StartLogger - Time: 12:40:24 PM Wednesday, September 19, 2001 Logger Alive: 12:40:24 PM Wednesday, September 19, 2001 Count:1 Text: Hello Asynchronous World - Time:12:40:28 PM Wednesday, September 19, 2001 Logger Alive: 12:40:30 PM Wednesday, September 19, 2001 Count:2 Text: Hello Asynchronous World - Time:12:40:30 PM Wednesday, September 19, 2001 Logger Alive: 12:40:35 PM Wednesday, September 19, 2001 Count:3 Text: Hello Asynchronous World - Time:12:40:35 PM Wednesday, September 19, 2001 Count:3 Text: Hello Asynchronous World - Time:12:40:35 PM Wednesday, September 19, 2001 Logger Alive: 12:40:39 PM Wednesday, September 19, 2001 Logger Alive: 12:40:44 PM Wednesday, September 19, 2001 StopLogger - Time:12:40:44 PM Wednesday, September 19, 2001 Note Because of the race condition during the last two asynchronous writes, the write counter is the same for both of these writes Stop the application and delete Log.txt 108 Module 14 (Optional): Threading and Asynchronous Programming Review Topic Objective To reinforce module objectives by reviewing key points The review questions cover some of the key concepts taught in the module Introduction to Threading ! Using Threads in NET ! Thread Safety ! Special Thread Topics ! Lead-in ! Asynchronous Programming in NET *****************************ILLEGAL FOR NON-TRAINER USE****************************** State one advantage and one disadvantage of using multiple threads in an application Advantages: Threading maintains the responsiveness of the user interface while background processing is occurring, allows for subtasks to be assigned different priorities, and allows a long-running task to be done in the background Disadvantages: Overhead with thread creation and running may decrease performance; sharing data between threads is complex and prone to errors Write the code to execute a thread on the static method in a class named MyClass that is declared: static void MyMethod() Thread t1 = new Thread(new ThreadStart(MyClass.MyMethod)); t1.Start(); Name the three NET Framework categories of techniques for providing thread safety when data must be shared between concurrently executing threads Synchronized Context, Synchronized Code Regions, Manual Synchronization Module 14 (Optional): Threading and Asynchronous Programming If you want to get or set properties, or call methods on a control from a background thread, what must you do? You must marshal the call to the thread on which the control was created by using one of the control’s thread safe methods: Invoke, BeginInvoke, and EndInvoke In the second part of an asynchronous call operation, name the four ways that the caller can know when the asynchronous operation has completed Callback method, poll, call end method, wait for event 109 THIS PAGE INTENTIONALLY LEFT BLANK ... resource at a particular time 6 Module 14 (Optional): Threading and Asynchronous Programming Standard design pattern for asynchronous programming The standard asynchronous design pattern in the... thread-safe code Module 14 (Optional): Threading and Asynchronous Programming ! vii Asynchronous Programming in NET Provide a brief definition of the concept of asynchronous programming as the... of their respective owners Module 14 (Optional): Threading and Asynchronous Programming Instructor Notes Module 14 Presentation: 150 Minutes Lab: 60 Minutes This module provides students with

Ngày đăng: 24/01/2014, 10:20

Từ khóa liên quan

Tài liệu cùng người dùng

  • Đang cập nhật ...

Tài liệu liên quan