31 August 2019

The Computer Science Activity Book

An exercise with my son.

The Computer Science Activity Book
24 Pen-and-Paper Projects to Explore the Wonderful World of Coding (No Computer Required!)
by Christine Liu and Tera Johnson

https://nostarch.com/csactivities


Practical Haskell A Real World Guide to Programming

Technical reviewed:

Practical Haskell
A Real World Guide to Programming
Authors: Serrano, Alejandro
© 2019

https://www.apress.com/gp/book/9781484244791


29 August 2019

Java 8 parallel streams pitfall

1.
All parallel streams use a common fork-join thread pool, and if you submit a long-running task, you effectively block all threads in the pool. Consequently, you block all other tasks that are using parallel streams.

2.
The default processing that occurs in such a Stream uses the ForkJoinPool.commonPool(), a Thread Pool shared by the entire application.

3.
This way we essentially force the parallel stream to have a ForkJoin as a parent thread, instead of a regular thread, so ForkJoinPool.commonPool is not used. Hooray!