Exchanger
Javaの並行APIについて読んでいるうちに、クラスについて知りました。
Java ドキュメントから、
"A synchronization point at which threads can pair and swap elements within pairs. Each thread presents some object on entry to the exchange method, matches with a partner thread, and receives its partner's object on return. An Exchanger may be viewed as a bidirectional form of a SynchronousQueue. Exchangers may be useful in
applications such as genetic algorithms and pipeline designs.
"
次のリンクを調べて見つけましたExchanger & GC-less Java
それは言います、
「Exchanger クラスは、Producer/Consumer などの 2 つのスレッド間でデータをやり取りするのに役立ちます。作業を渡すために使用されるデータ構造を自然にリサイクルする特性があり、効率的な方法で GC を使用しない作業の共有をサポートします。」
どのようにサポートし"GC-less sharing of work"
ますか?