1

I want to sort an array using multiple syncronized threads. For example I want to use at least 2 threads to sort the array and another thread to show me at some moments the situation of sorting. Some ideas please?

3
  • 2
    THe idea here would be: Write some code and ask us if you have specific problems. Commented Nov 21, 2010 at 18:41
  • Two synchronized Threads are equal to one Thread. Isn't it? Commented Nov 21, 2010 at 18:47
  • @Martijn, no. You can think of two synchronized threads as two threads which have no race conditions. Commented Nov 21, 2010 at 19:17

2 Answers 2

3

You can employ JSR 166y Fork Join framework to do parallel merge sort. You can see examples here and here.

Sign up to request clarification or add additional context in comments.

Comments

1

Have you looked at:

java.util.Arrays.sort();

It doesn't use 2 threads - but how can that possibly be a requirement?

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.