Microsoft Visual C#. NET 2003 Kick Start
Authors: Holzner S.
Published year: 2002
Pages: 153-156/181
Buy this book on amazon.com >>

In Brief

In this chapter, we took a look at multithreading and remoting. Here's an overview of the topics:

  • Multithreading is all about hosting multiple threads in addition to an application's main thread, and using them as multiple streams of execution. You can create new threads with the Thread class. This class has various methods you can use to control threads: Start , Suspend , Resume , Sleep , Join , Abort , and so on.

  • You can give a thread its own code by placing that code in a method, which you pass to the Thread constructor. Do not handle user interface elements like forms or controls in any thread but the main one.

  • You can synchronize threads with lock and Monitor statements, avoiding conflict when threads use shared resources.

  • Remoting is the technique of passing objects across process or machine boundaries. By basing a class on MarshalByRefObject , you can export that type from the server to the client. And you can use the HttpChannel to communicate between the server and the client.

  • You can also send an object (not just a type) from the server to the client. In that case, you use the RemotingServices.Marshal method.

  • SOAP provides another mechanism for remoting. You can use the SoapFormatter class in the server to serialize an object to disk, for example, and this same class's Deserialize method to connect to the server.

And That's It

And that's itthat completes our survey of C#. We've come far in this book, from the very basics up through OOP, inheritance, delegates, streams, indexers, collections, Windows and Web applications, ADO.NET and databases, user controls and Web user controls, Windows Services, Web Services, deployment, assemblies and security, attributes and reflection, and now multithreading and remoting. We've become acquainted with all of these topics and dozens more in this book. In a programmer-to-programmer treatment like this, the idea is not to drag in all the beginning material from scratch, but to give you what you need as a knowledgeable programmer to hit the ground running. There's an incredible richness here for you to exploitall that's left is to put it to use. Happy programming.

[SYMBOL] [A] [B] [C] [D] [E] [F] [G] [H] [I] [J] [K] [L] [M] [N] [O] [P] [Q] [R] [S] [T] [U] [V] [W] [X] [Z]


[SYMBOL] [A] [B] [C] [D] [E] [F] [G] [H] [I] [J] [K] [L] [M] [N] [O] [P] [Q] [R] [S] [T] [U] [V] [W] [X] [Z]

< button
       datasets
               navigating  
<< button
       datasets
               navigating   2nd  
(directory separator character)  
(id) property
       HTML buttons
               naming  
+ operator
       strings  
-T switch
       assemblies
               checking strong name signatures  
.NET Framework
       asynchronous I/O   2nd   3rd  
       asynchronous network I/O   2nd  
               creating asynchronous network clients   2nd  
               creating asynchronous network servers   2nd   3rd  
       network I/O  
               creating network clients   2nd  
               creating network servers   2nd   3rd   4th   5th   6th  
/** ‰*/ comments  
/* ‰*/ comments   2nd  
// comments  
/// comments  
       Web reports
               creating   2nd  
       XML documentation files
               creating  
/embed switch
       files
               loading into assemblies  
== operators  
       overloading   2nd   3rd  
[] operators
       collections  
[NonSerialized] attribute   2nd  

Microsoft Visual C#. NET 2003 Kick Start
Authors: Holzner S.
Published year: 2002
Pages: 153-156/181
Buy this book on amazon.com >>