I'm using this code to write to a text file using many threads at the same time. (Parallel.Foreach a list) with a high thread count.
However, I've noticed that multi thread doesn't increase the speed from a normal foreach when using this method.
Is there any other efficient way to output a lot of data to somewhere (preferably to a file)?
I need it to be super super quick.
Cheers
However, I've noticed that multi thread doesn't increase the speed from a normal foreach when using this method.
PHP Code
<?php
public static void WriteDebug(string pathFile, string text)
{
try
{
locker.AcquireWriterLock(int.MaxValue);
File.AppendAllText(pathFile, text + Environment.NewLine);
}
finally
{
locker.ReleaseWriterLock();
}
}
Is there any other efficient way to output a lot of data to somewhere (preferably to a file)?
I need it to be super super quick.
Cheers





![[Image: ME3mSDm.gif]](https://i.imgur.com/ME3mSDm.gif)