I have been thinking about concurrency and parallelism a bit recently (hard not to when you are taking a course on functional programming and in your daily work develop software targeting a many-core processor). I thought it would be interesting to read up a bit on how to do parallelism in Java. After a bit of searching the net I found this Oracle article by Julien Ponge.
The article starts by describing the usage of Plain Old Threads (POT) and the shortcomings involved in using them. It goes on describing the introduction of the concurrent packages in Java 5 which was later refined in Java 6 and finally introduces fork/join that was added in Java 7.
The article has many examples and a provides a good overview of concurrency and parallelism in Java 7. I would recommend a read through for anyone planning to go beyond single threading in Java.
Me, I am planning to do some benchmarking sorting 1 GB of random ints. Maybe the generation of the ints can be done in parallel as well...
The article starts by describing the usage of Plain Old Threads (POT) and the shortcomings involved in using them. It goes on describing the introduction of the concurrent packages in Java 5 which was later refined in Java 6 and finally introduces fork/join that was added in Java 7.
The article has many examples and a provides a good overview of concurrency and parallelism in Java 7. I would recommend a read through for anyone planning to go beyond single threading in Java.
Me, I am planning to do some benchmarking sorting 1 GB of random ints. Maybe the generation of the ints can be done in parallel as well...
Kommentarer
Skicka en kommentar