parallel code readability issue #39

semihokur opened this Issue Mar 30, 2013 · 3 comments


None yet
2 participants

I am a second-year PhD student in computer science at the University of Illinois at Urbana-Champaign. I am working on a refactoring tool improving the parallel code readability. I have found out some opportunities in your project. I want to ask whether these kind of patches are useful for you.

(from MultiQueuedHandler.cs file)

        var stopTasks = new Task[Queues.Length];
        for (int i = 0; i < Queues.Length; ++i)
            int queueNum = i;
            stopTasks[i] = Task.Factory.StartNew(() => Queues[queueNum].Stop());

can be converted to:

Parallel.ForEach (Queues, (queue) => queue.Stop());

Do you accept these kind of changes as patches? I am asking because one of the way demonstrating our tool is to show how many patches are accepted. Please let me know asap because it is really important for my research.

Semih Okur


gregoryyoung commented Apr 2, 2013

Those two bits of code are not the same. What happens if Queues changes during the iteration? Though looking at this there is another possible bug here. I will go patch it.

If the codes were actually the same I would have not problem accepting a patch,


gregoryyoung commented Apr 2, 2013

actually from looking queues is immutable so it doesnt matter much. The same can be done a couple of other places in that file as well. if you want to patch feel free otherwise we will patch.

Sorry for tardy response, I sent an email to your address.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment