Streams can't be played, it is better to use Task.Asynchronous programming in task-basedParallel.ForEach MethodWhen to use Parallel.ForEach and PLINQ when
Imagine that proxy.txt this is the list of tasks when reading a file you create and transmit to the ThreadPool, it will distribute them between CPU cores and allocate the desired number of threads. Your task will be reduced only to the "bonding" of the results. Record the result immediately after the task ended, but you can just keep oprative, and write only at the end.
Look for another thread-safe collection