The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

Monica_G (28) [Avatar] Offline
#1
Hi,

In the intro of chapter 5, it states "In addition, using internal iteration, the Streams API can decide to run your code in parallel". Does this mean even if a sequential stream is used the operations could still be executed in parallel? If so, what happens if there is bad code that uses mutable state? Will the Streams API recognize that and run the code sequentially? Or would it run it in parallel with potentially a race condition occurring?

Thank you,

Monica