• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Knute Snortum
  • Bear Bibeault
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Tim Holloway

OCPJP 8 Study Guide - Updates on Java 8 multithreading?

 
Ranch Hand
Posts: 112
3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have any of the new Java 8 multithreading APIs been added to the exam or the book?
 
author
Posts: 8995
19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well... added from when?  
 
author
Posts: 200
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
One addition that's totally new in 8 is multi-threading with streams - it's built on the FJP, but the syntax of parallel streams will be new to you.

 
Kent O. Johnson
Ranch Hand
Posts: 112
3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It seems worth mentioning the criticism of FJP in Java 8 for parallelizing I/O operations with streams as seen here

This is the original article. Do you, Elizabeth or Kathy, have any opinion or thoughts on that article? The basic gist of it is that FJP is only useful in the use case where a problem uses in-memory, unordered data structures and can be easily split up into multiple sub problems.
 
Marshal
Posts: 64710
226
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There might be a bit of exaggeration in that article; you will find a balanced argument in Urma Fusco and Mycroft and Ken Kousen's Modern Java Recipes (pages209‑215). Certainly the performance of parallel and sequential Streams is rather unpredictable and counter‑intuitive.
 
Kent O. Johnson
Ranch Hand
Posts: 112
3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the mentions of those books! I am going to get both of them. I really like Ken's thinking style and am thinking the Mycroft book will be great as well.
 
Elisabeth Robson
author
Posts: 200
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I would agree with that assessment about parallel streams in terms of the applicability to certain kinds of problems, and we say that in the book too... concurrency and parallelism definitely require careful thought about what kind of problem you have and how it's structured. I think there are certain problems where parallel streams will make sense and many where they won't; on those that do, I think the syntax - once you get the hang of streams - is straightforward and so can make your program potentially shorter and possibly a bit easier to understand (at least, for those familiar with streams).

We do a performance comparison on an admittedly simple problem in the book and I found parallel streams to be in line with the other solutions, that also use FJ so I'm not sure I agree that parallel streams are any worse than using the regular fork/join structure, but also, I haven't tested them on a large number of problems. With regards to their other criticisms of the underlying FJ framework I will leave that for another discussion...

Personally I think that for problems that call for heavy duty parallelism, Java is may not the right language and solution; for situations that aren't particularly time critical (meaning they can run in a reasonable amount of time if parallelized that's "good enough") then it's fine, especially if your other code is in Java and it would be inconvenient to switch platforms.

My 2c on this topic - which of course could be discussed ad infinitum :-)

 
Campbell Ritchie
Marshal
Posts: 64710
226
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Kent O. Johnson wrote:. . . I am going to get both of them. . . .

Careful; the publishers sometimes have special offers and you can get a book at 50% off for twenty‑four hours. Urma Fusco and Mycroft came up for 50% off about two weeks ago, and it is possible it will have a similar offer in future too.
 
Kent O. Johnson
Ranch Hand
Posts: 112
3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Campbell Ritchie wrote:...the publishers sometimes have special offers...



Thanks for the heads up. I'll keep my eye out for the offer
 
Campbell Ritchie
Marshal
Posts: 64710
226
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Kent O. Johnson wrote:. . . Thanks . . .

That's a pleasure Some American publishers have wide-ranging discounts for one day, only I have forgotten when it is.
 
Campbell Ritchie
Marshal
Posts: 64710
226
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Campbell Ritchie wrote:. . .  one day, only I have forgotten when it is.

It might be after 30th October and before 1st November, though
 
Campbell Ritchie
Marshal
Posts: 64710
226
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

On Wednesday, I wrote:. . . . after 30th October and before 1st November . . .

Maybe if you sign up here, you might find a 50% off day on 25th May.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!