I just wonder is parallel File.Read
using PLINQ/Parallel can be faster? My code is as follows ( .Net 4.0):
public static void ReadFileParallel(List<string> fileName)
{
Parallel.Foreach(fileName, file=>File.Read(file));
}
public static void ReadFilePLINQ(List<string> fileName)
{
fileName.AsParallel().foreach(file=>File.Read(file));
}
The reason I ask this is because I thought that file reading is IO bound, so doing parallel won't help, am I right?
There is an excellent PDF from MSFT which goes into detail regarding Parallel and threading possibilities.
It might help.
http://www.microsoft.com/downloads/details.aspx?FamilyID=86b3d32b-ad26-4bb8-a3ae-c1637026c3ee&displaylang=en