As depicted in
Apple Passing
is the trditional Producer-Consumer question, we have 3 kinds thread group and 2 kinds threshold, Producer Threads
add Apple entity to appleQueue
, Marker Threads
get Apple from appleQueue
and add a unique mark reconstruct a new Entity MarkedApple
then add new Entity to markedAppleQueue
, Consumer Threads
consume MarkedApple from markedAppleQueue
, note that appleQueue
and markedAppleQueu
treated as threshold.
We can run ApplePassing
from source code via following steps:
-
build and copy dependency jar
mvn clean dependency:copy-dependencies install
-
Start
ApplePassing
java -cp applePassing-1.0.jar:log4j-1.2.16.jar com.kylin.applepassing.Main -h
-
Stop
ApplePassing
Any time, entry exit
,quit
,q!
will stop ApplePassing