Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Multithreading using StreamWriter
Message
From
02/04/2012 18:26:07
 
 
General information
Forum:
ASP.NET
Category:
Other
Environment versions
Environment:
C# 4.0
OS:
Windows XP SP2
Network:
Windows 2008 Server
Application:
Desktop
Miscellaneous
Thread ID:
01540059
Message ID:
01540102
Views:
36
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.
Previous
Reply
Map
View

Click here to load this message in the networking platform