Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Multithreading using StreamWriter
Message
De
02/04/2012 18:26:07
 
 
À
02/04/2012 16:15:21
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Versions des environnements
Environment:
C# 4.0
OS:
Windows XP SP2
Network:
Windows 2008 Server
Application:
Desktop
Divers
Thread ID:
01540059
Message ID:
01540102
Vues:
37
The streamwriter object is local to each instance of the function call. The name shouldn't matter. You should, however, put the streamwriter in a using block. That will automatically take care of the close and dispose.

As far as speed gains go, you probably won't be seeing much, and it may actually be slower. Making a process parallel typically helps when it is a cpu intensive task. In your case you are probably limited by the disk write speed. In addition, since you will be writing to multiple files, there may be disk seeks involved when it switches between the files, which would slow down the total speed. I may be wrong about the speed though, so you will probably still want to test it.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform