private List<int> DiffMethod(ThreadSafeFileLineQueue queueA, ThreadSafeFileLineQueue queueB)
        {
            var diffIndexes = new List<int>();
            int lineIndex = 0;
            string lineA, lineB;

            while ((lineA = queueA.Dequeue()) != null & (lineB = queueB.Dequeue()) != null)
            {
                if (lineA != lineB)
                {
                    diffIndexes.Add(lineIndex);
                }
                lineIndex++;
            }

            while (lineA != null)
            {
                diffIndexes.Add(lineIndex++);
                lineA = queueA.Dequeue();
            }

            while (lineB != null)
            {
                diffIndexes.Add(lineIndex++);
                lineB = queueB.Dequeue();
            }

            return diffIndexes;
        }
 private void ReadFileMethod(string fileName, ThreadSafeFileLineQueue queue)
 {
     using (var fileStreamA = new StreamReader(File.OpenRead(fileName)))
     {
         while (!fileStreamA.EndOfStream)
         {
             queue.Enqueue(fileStreamA.ReadLine());
         }
         queue.FinishAdding();
     }
 }
        public List<int> FindDiff(string fileNameA, string fileNameB)
        {
            _stopwatch.Start();

            var queueA = new ThreadSafeFileLineQueue();
            var queueB = new ThreadSafeFileLineQueue();

            var taskA = Task.Run(() => ReadFileMethod(fileNameA, queueA));
            var taskB = Task.Run(() => ReadFileMethod(fileNameB, queueB));
            var taskC = Task.Run(() => DiffMethod(queueA, queueB));

            Task.WaitAll(taskA, taskB, taskC);

            _stopwatch.Stop();

            return taskC.Result;
        }