Skip to content

[Chapter 1] 라이브러리 메서드에 Predicate<T>를 추가하는 것이 병렬성 문제를 일으키는 이유 #4

@jaeminkim90

Description

@jaeminkim90

p.55
filter(inventory, (Apple a) ->a.getWeight() >150 ); 하지만 병렬성이라는 중요성 때문에 설계자들은 이와 같은 설계를 포기했다.

image

"병렬성이라는 중요성 때문에 설계자들은 이와 같은 설계를 포기했다."고 설명한 내용이 잘 이해가 안되네요.
filter 라이브러리 메서드를 static <T> Collection<T> filter(Collection(<T> c, Predicate<T> p);와 같은 방식으로 구현하여, filterApples(inventory, (Apple a) -> a.getWeight() > 150 );의 기능을 대체하는 것이 병렬성에 왜 문제가 되는지 궁금합니다.

Metadata

Metadata

Labels

questionFurther information is requested

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions