여태까지 멀티 스레딩이나 병렬성 등에 대한 것들은 개념만 알 뿐 실제 어떤 방식으로 코드가 구동되는지 원리를 알지 못했는데, 이번 챕터를 통해 병렬화의 내부 원리(fork-join)에 대한 개념을 익히고 ExecutorService 및 Spliterator를 제작해보면서 어렴풋이나마 이해할 수 있었다.
다만 실제로 어떤 api를 작성할 때 병렬 처리를 하라고 하면 엄청 힘들것같다는 느낌이 들었다... 완벽하게 익힌다기보다는 이러한 개념이 있다는것을 알고 필요할때 관련 지식을 틈틈히 학습해야겠다.
병렬 스트림이 내부적으로 여러 부분들로 쪼개서 연산한다는 것을 알게 됐다. 그리고 내부 반복을 사용해서 for 루프보다 무조건 빠른 줄 알았는데 예시에서 굉장히 큰 수를 더해가는 과정에서 병렬 스트림이 가장 느린 부분이 인상적이었다. 물론 이 부분은 자료구조의 변경으로 가장 빠른 동작을 하도록 수정하긴했다.
포크/조인 프레임워크 같은 경우는 사용해본 적이 없고, 병렬 스트림처럼 분할-정복식으로 연산한다는 정도까지만 이해했다. 상대적으로 가벼운 마음으로 읽었고 추후에 필요할 경우 다시 정독해야겠다.
기간
진행자