package queue;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit; /**
* Created by MyWorld on 2016/2/1.
*/
public class App {
public static LinkedBlockingQueue<String> queue = new LinkedBlockingQueue(2);
public static ExecutorService executorService = new ThreadPoolExecutor(5, 10,
60L, TimeUnit.SECONDS,
new LinkedBlockingQueue<Runnable>()); public static void main(String[] args) {
App.executorService.execute(new Producer());
while (true) {
System.out.println(String.format("%s current size: %s", Thread.currentThread().toString(), queue.size()));
try {
TimeUnit.SECONDS.sleep(2);
} catch (InterruptedException e) {
e.printStackTrace();
}
} } }
package queue;

import java.util.Random;
import java.util.concurrent.TimeUnit; /**
* Created by MyWorld on 2016/2/1.
*/
public class Producer implements Runnable {
static {
System.out.println(String.format("%s success to init", Thread.currentThread().toString()));
App.executorService.execute(new ConsumerManager());
} @Override
public void run() {
String[] chars = {"A", "B", "C", "D"};
Random random = new Random();
while (true) {
String tag = chars[random.nextInt(3)];
for (int i = 0; i < 100; i++) {
String produceValue = tag + i;
System.out.println(String.format("%s produce value: %s", Thread.currentThread().toString(), produceValue));
App.queue.add(produceValue);
try {
TimeUnit.SECONDS.sleep(1);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}
} }
package queue;

import java.util.HashSet;
import java.util.Set;
import java.util.concurrent.TimeUnit; /**
* Created by MyWorld on 2016/2/1.
*/
public class ConsumerManager implements Runnable {
@Override
public void run() {
Set<String> cache = new HashSet<String>();
while (true) {
try {
String value = App.queue.poll(5, TimeUnit.SECONDS);
if (value == null) {
if (!cache.isEmpty()) {
cache = addToDo(cache);
}
value = App.queue.take();
System.out.println(String.format("%s take value: %s", Thread.currentThread().toString(), value));
cache.add(value);
} else {
System.out.println(String.format("%s poll value: %s", Thread.currentThread().toString(), value));
cache.add(value);
if (cache.size() > 10) {
cache = addToDo(cache);
}
}
} catch (Exception e) {
e.printStackTrace();
}
}
} private Set<String> addToDo(Set<String> cache) {
App.executorService.execute(new Worker(cache));
cache = new HashSet<String>();
return cache;
} }
package queue;

import java.util.Set;

/**
* Created by MyWorld on 2016/2/1.
*/
public class Worker implements Runnable {
private Set<String> cache; public Worker(Set<String> cache) {
this.cache = cache;
} @Override
public void run() {
for (String value : cache) {
System.out.println(String.format("%s worker consume value: %s", Thread.currentThread().toString(), value));
}
}
}

Output:

Thread[main,5,main] success to init
Thread[main,5,main] current size: 0
Thread[pool-1-thread-2,5,main] produce value: C0
Thread[pool-1-thread-1,5,main] poll value: C0
Thread[pool-1-thread-2,5,main] produce value: C1
Thread[pool-1-thread-1,5,main] poll value: C1
Thread[main,5,main] current size: 0
Thread[pool-1-thread-2,5,main] produce value: C2
Thread[pool-1-thread-1,5,main] poll value: C2
Thread[pool-1-thread-2,5,main] produce value: C3
Thread[pool-1-thread-1,5,main] poll value: C3
Thread[main,5,main] current size: 0
Thread[pool-1-thread-2,5,main] produce value: C4
Thread[pool-1-thread-1,5,main] poll value: C4
Thread[pool-1-thread-2,5,main] produce value: C5
Thread[pool-1-thread-1,5,main] poll value: C5
Thread[main,5,main] current size: 0
Thread[pool-1-thread-2,5,main] produce value: C6
Thread[pool-1-thread-1,5,main] poll value: C6
Thread[pool-1-thread-2,5,main] produce value: C7
Thread[pool-1-thread-1,5,main] poll value: C7
Thread[main,5,main] current size: 0
Thread[pool-1-thread-2,5,main] produce value: C8
Thread[pool-1-thread-1,5,main] poll value: C8
Thread[pool-1-thread-2,5,main] produce value: C9
Thread[pool-1-thread-1,5,main] poll value: C9
Thread[main,5,main] current size: 0
Thread[pool-1-thread-2,5,main] produce value: C10
Thread[pool-1-thread-1,5,main] poll value: C10
Thread[pool-1-thread-3,5,main] worker consume value: C8
Thread[pool-1-thread-3,5,main] worker consume value: C7
Thread[pool-1-thread-3,5,main] worker consume value: C9
Thread[pool-1-thread-3,5,main] worker consume value: C4
Thread[pool-1-thread-3,5,main] worker consume value: C3
Thread[pool-1-thread-3,5,main] worker consume value: C6
Thread[pool-1-thread-3,5,main] worker consume value: C5
Thread[pool-1-thread-3,5,main] worker consume value: C0
Thread[pool-1-thread-3,5,main] worker consume value: C10
Thread[pool-1-thread-3,5,main] worker consume value: C1
Thread[pool-1-thread-3,5,main] worker consume value: C2
Thread[pool-1-thread-2,5,main] produce value: C11
Thread[pool-1-thread-1,5,main] poll value: C11
Thread[main,5,main] current size: 0
Thread[pool-1-thread-2,5,main] produce value: C12
Thread[pool-1-thread-1,5,main] poll value: C12
Thread[pool-1-thread-2,5,main] produce value: C13
Thread[pool-1-thread-1,5,main] poll value: C13
Thread[main,5,main] current size: 0
Thread[pool-1-thread-2,5,main] produce value: C14
Thread[pool-1-thread-1,5,main] poll value: C14
Thread[pool-1-thread-2,5,main] produce value: C15
Thread[pool-1-thread-1,5,main] poll value: C15
Thread[main,5,main] current size: 0
Thread[pool-1-thread-2,5,main] produce value: C16
Thread[pool-1-thread-1,5,main] poll value: C16
Thread[pool-1-thread-2,5,main] produce value: C17
Thread[pool-1-thread-1,5,main] poll value: C17
Thread[main,5,main] current size: 0
Thread[pool-1-thread-2,5,main] produce value: C18
Thread[pool-1-thread-1,5,main] poll value: C18
Thread[pool-1-thread-2,5,main] produce value: C19
Thread[pool-1-thread-1,5,main] poll value: C19
Thread[main,5,main] current size: 0
Thread[pool-1-thread-2,5,main] produce value: C20
Thread[pool-1-thread-1,5,main] poll value: C20
Thread[pool-1-thread-2,5,main] produce value: C21
Thread[pool-1-thread-1,5,main] poll value: C21
Thread[pool-1-thread-4,5,main] worker consume value: C16
Thread[pool-1-thread-4,5,main] worker consume value: C17
Thread[pool-1-thread-4,5,main] worker consume value: C18
Thread[pool-1-thread-4,5,main] worker consume value: C19
Thread[pool-1-thread-4,5,main] worker consume value: C11
Thread[pool-1-thread-4,5,main] worker consume value: C21
Thread[pool-1-thread-4,5,main] worker consume value: C12
Thread[pool-1-thread-4,5,main] worker consume value: C13
Thread[pool-1-thread-4,5,main] worker consume value: C14
Thread[pool-1-thread-4,5,main] worker consume value: C20
Thread[pool-1-thread-4,5,main] worker consume value: C15
Thread[main,5,main] current size: 0
Thread[pool-1-thread-2,5,main] produce value: C22
Thread[pool-1-thread-1,5,main] poll value: C22
Thread[pool-1-thread-2,5,main] produce value: C23
Thread[pool-1-thread-1,5,main] poll value: C23
Thread[main,5,main] current size: 0
Thread[pool-1-thread-2,5,main] produce value: C24
Thread[pool-1-thread-1,5,main] poll value: C24
Thread[pool-1-thread-2,5,main] produce value: C25
Thread[pool-1-thread-1,5,main] poll value: C25
Thread[main,5,main] current size: 0
Thread[pool-1-thread-2,5,main] produce value: C26
Thread[pool-1-thread-1,5,main] poll value: C26
Thread[pool-1-thread-2,5,main] produce value: C27
Thread[pool-1-thread-1,5,main] poll value: C27
Thread[main,5,main] current size: 0
Thread[pool-1-thread-2,5,main] produce value: C28
Thread[pool-1-thread-1,5,main] poll value: C28
Thread[pool-1-thread-2,5,main] produce value: C29
Thread[pool-1-thread-1,5,main] poll value: C29
Thread[main,5,main] current size: 0
Thread[pool-1-thread-2,5,main] produce value: C30
Thread[pool-1-thread-1,5,main] poll value: C30
Thread[pool-1-thread-2,5,main] produce value: C31
Thread[pool-1-thread-1,5,main] poll value: C31
Thread[main,5,main] current size: 0
Thread[pool-1-thread-2,5,main] produce value: C32
Thread[pool-1-thread-1,5,main] poll value: C32
Thread[pool-1-thread-5,5,main] worker consume value: C29
Thread[pool-1-thread-5,5,main] worker consume value: C27
Thread[pool-1-thread-5,5,main] worker consume value: C28
Thread[pool-1-thread-5,5,main] worker consume value: C25
Thread[pool-1-thread-5,5,main] worker consume value: C26
Thread[pool-1-thread-5,5,main] worker consume value: C23
Thread[pool-1-thread-5,5,main] worker consume value: C24
Thread[pool-1-thread-5,5,main] worker consume value: C30
Thread[pool-1-thread-5,5,main] worker consume value: C31
Thread[pool-1-thread-5,5,main] worker consume value: C22
Thread[pool-1-thread-5,5,main] worker consume value: C32
Thread[pool-1-thread-2,5,main] produce value: C33
Thread[pool-1-thread-1,5,main] poll value: C33
Thread[main,5,main] current size: 0
Thread[pool-1-thread-2,5,main] produce value: C34
Thread[pool-1-thread-1,5,main] poll value: C34
Thread[pool-1-thread-2,5,main] produce value: C35
Thread[pool-1-thread-1,5,main] poll value: C35
Thread[main,5,main] current size: 0
Thread[pool-1-thread-2,5,main] produce value: C36
Thread[pool-1-thread-1,5,main] poll value: C36
Thread[pool-1-thread-2,5,main] produce value: C37
Thread[pool-1-thread-1,5,main] poll value: C37
Thread[main,5,main] current size: 0
Thread[pool-1-thread-2,5,main] produce value: C38
Thread[pool-1-thread-1,5,main] poll value: C38
Thread[pool-1-thread-2,5,main] produce value: C39
Thread[pool-1-thread-1,5,main] poll value: C39
Thread[main,5,main] current size: 0
Thread[pool-1-thread-2,5,main] produce value: C40
Thread[pool-1-thread-1,5,main] poll value: C40
Thread[pool-1-thread-2,5,main] produce value: C41
Thread[pool-1-thread-1,5,main] poll value: C41
Thread[main,5,main] current size: 0
Thread[pool-1-thread-2,5,main] produce value: C42
Thread[pool-1-thread-1,5,main] poll value: C42
Thread[pool-1-thread-2,5,main] produce value: C43
Thread[pool-1-thread-1,5,main] poll value: C43
Thread[pool-1-thread-3,5,main] worker consume value: C40
Thread[pool-1-thread-3,5,main] worker consume value: C42
Thread[pool-1-thread-3,5,main] worker consume value: C38
Thread[pool-1-thread-3,5,main] worker consume value: C41
Thread[pool-1-thread-3,5,main] worker consume value: C39
Thread[pool-1-thread-3,5,main] worker consume value: C43
Thread[pool-1-thread-3,5,main] worker consume value: C34
Thread[pool-1-thread-3,5,main] worker consume value: C35
Thread[pool-1-thread-3,5,main] worker consume value: C36
Thread[pool-1-thread-3,5,main] worker consume value: C37
Thread[pool-1-thread-3,5,main] worker consume value: C33
Thread[main,5,main] current size: 0
Thread[pool-1-thread-2,5,main] produce value: C44
Thread[pool-1-thread-1,5,main] poll value: C44
Thread[pool-1-thread-2,5,main] produce value: C45
Thread[pool-1-thread-1,5,main] poll value: C45
Thread[main,5,main] current size: 0
Thread[pool-1-thread-2,5,main] produce value: C46
Thread[pool-1-thread-1,5,main] poll value: C46
Thread[pool-1-thread-2,5,main] produce value: C47
Thread[pool-1-thread-1,5,main] poll value: C47
Thread[main,5,main] current size: 0
Thread[pool-1-thread-2,5,main] produce value: C48
Thread[pool-1-thread-1,5,main] poll value: C48
Thread[pool-1-thread-2,5,main] produce value: C49
Thread[pool-1-thread-1,5,main] poll value: C49
Thread[main,5,main] current size: 0
Thread[pool-1-thread-2,5,main] produce value: C50
Thread[pool-1-thread-1,5,main] poll value: C50
Thread[pool-1-thread-2,5,main] produce value: C51
Thread[pool-1-thread-1,5,main] poll value: C51
Thread[main,5,main] current size: 0
Thread[pool-1-thread-2,5,main] produce value: C52
Thread[pool-1-thread-1,5,main] poll value: C52
Thread[pool-1-thread-2,5,main] produce value: C53
Thread[pool-1-thread-1,5,main] poll value: C53
Thread[main,5,main] current size: 0
Thread[pool-1-thread-2,5,main] produce value: C54
Thread[pool-1-thread-1,5,main] poll value: C54
Thread[pool-1-thread-4,5,main] worker consume value: C46
Thread[pool-1-thread-4,5,main] worker consume value: C45
Thread[pool-1-thread-4,5,main] worker consume value: C48
Thread[pool-1-thread-4,5,main] worker consume value: C47
Thread[pool-1-thread-4,5,main] worker consume value: C54
Thread[pool-1-thread-4,5,main] worker consume value: C53
Thread[pool-1-thread-4,5,main] worker consume value: C44
Thread[pool-1-thread-4,5,main] worker consume value: C52
Thread[pool-1-thread-4,5,main] worker consume value: C50
Thread[pool-1-thread-4,5,main] worker consume value: C51
Thread[pool-1-thread-4,5,main] worker consume value: C49
Thread[pool-1-thread-2,5,main] produce value: C55
Thread[pool-1-thread-1,5,main] poll value: C55
Thread[main,5,main] current size: 0
Thread[pool-1-thread-2,5,main] produce value: C56
Thread[pool-1-thread-1,5,main] poll value: C56
Thread[pool-1-thread-2,5,main] produce value: C57
Thread[pool-1-thread-1,5,main] poll value: C57
Thread[main,5,main] current size: 0
Thread[pool-1-thread-2,5,main] produce value: C58
Thread[pool-1-thread-1,5,main] poll value: C58
Thread[pool-1-thread-2,5,main] produce value: C59
Thread[pool-1-thread-1,5,main] poll value: C59
Thread[main,5,main] current size: 0
Thread[pool-1-thread-2,5,main] produce value: C60
Thread[pool-1-thread-1,5,main] poll value: C60
Thread[pool-1-thread-2,5,main] produce value: C61
Thread[pool-1-thread-1,5,main] poll value: C61
Thread[main,5,main] current size: 0
Thread[pool-1-thread-2,5,main] produce value: C62
Thread[pool-1-thread-1,5,main] poll value: C62
Thread[pool-1-thread-2,5,main] produce value: C63
Thread[pool-1-thread-1,5,main] poll value: C63
Thread[main,5,main] current size: 0
Thread[pool-1-thread-2,5,main] produce value: C64
Thread[pool-1-thread-1,5,main] poll value: C64
Thread[pool-1-thread-2,5,main] produce value: C65
Thread[pool-1-thread-1,5,main] poll value: C65
Thread[pool-1-thread-5,5,main] worker consume value: C64
Thread[pool-1-thread-5,5,main] worker consume value: C59
Thread[pool-1-thread-5,5,main] worker consume value: C63
Thread[pool-1-thread-5,5,main] worker consume value: C58
Thread[pool-1-thread-5,5,main] worker consume value: C57
Thread[pool-1-thread-5,5,main] worker consume value: C65
Thread[pool-1-thread-5,5,main] worker consume value: C56
Thread[pool-1-thread-5,5,main] worker consume value: C55
Thread[pool-1-thread-5,5,main] worker consume value: C61
Thread[pool-1-thread-5,5,main] worker consume value: C62
Thread[pool-1-thread-5,5,main] worker consume value: C60
Thread[main,5,main] current size: 0
Thread[pool-1-thread-2,5,main] produce value: C66
Thread[pool-1-thread-1,5,main] poll value: C66
Thread[pool-1-thread-2,5,main] produce value: C67
Thread[pool-1-thread-1,5,main] poll value: C67
Thread[main,5,main] current size: 0
Thread[pool-1-thread-2,5,main] produce value: C68
Thread[pool-1-thread-1,5,main] poll value: C68
Thread[pool-1-thread-2,5,main] produce value: C69
Thread[pool-1-thread-1,5,main] poll value: C69
Thread[main,5,main] current size: 0
Thread[pool-1-thread-2,5,main] produce value: C70
Thread[pool-1-thread-1,5,main] poll value: C70
Thread[pool-1-thread-2,5,main] produce value: C71
Thread[pool-1-thread-1,5,main] poll value: C71
Thread[main,5,main] current size: 0
Thread[pool-1-thread-2,5,main] produce value: C72
Thread[pool-1-thread-1,5,main] poll value: C72
Thread[pool-1-thread-2,5,main] produce value: C73
Thread[pool-1-thread-1,5,main] poll value: C73
Thread[main,5,main] current size: 0
Thread[pool-1-thread-2,5,main] produce value: C74
Thread[pool-1-thread-1,5,main] poll value: C74
Thread[pool-1-thread-2,5,main] produce value: C75
Thread[pool-1-thread-1,5,main] poll value: C75
Thread[main,5,main] current size: 0
Thread[pool-1-thread-2,5,main] produce value: C76
Thread[pool-1-thread-1,5,main] poll value: C76
Thread[pool-1-thread-3,5,main] worker consume value: C76
Thread[pool-1-thread-3,5,main] worker consume value: C75
Thread[pool-1-thread-3,5,main] worker consume value: C66
Thread[pool-1-thread-3,5,main] worker consume value: C74
Thread[pool-1-thread-3,5,main] worker consume value: C68
Thread[pool-1-thread-3,5,main] worker consume value: C67
Thread[pool-1-thread-3,5,main] worker consume value: C69
Thread[pool-1-thread-3,5,main] worker consume value: C70
Thread[pool-1-thread-3,5,main] worker consume value: C71
Thread[pool-1-thread-3,5,main] worker consume value: C72
Thread[pool-1-thread-3,5,main] worker consume value: C73
Thread[pool-1-thread-2,5,main] produce value: C77
Thread[pool-1-thread-1,5,main] poll value: C77
Thread[main,5,main] current size: 0
Thread[pool-1-thread-2,5,main] produce value: C78
Thread[pool-1-thread-1,5,main] poll value: C78
Thread[pool-1-thread-2,5,main] produce value: C79
Thread[pool-1-thread-1,5,main] poll value: C79
Thread[main,5,main] current size: 0
Thread[pool-1-thread-2,5,main] produce value: C80
Thread[pool-1-thread-1,5,main] poll value: C80
Thread[pool-1-thread-2,5,main] produce value: C81
Thread[pool-1-thread-1,5,main] poll value: C81
Thread[main,5,main] current size: 0
Thread[pool-1-thread-2,5,main] produce value: C82
Thread[pool-1-thread-1,5,main] poll value: C82
Thread[pool-1-thread-2,5,main] produce value: C83
Thread[pool-1-thread-1,5,main] poll value: C83
Thread[main,5,main] current size: 0
Thread[pool-1-thread-2,5,main] produce value: C84
Thread[pool-1-thread-1,5,main] poll value: C84
Thread[pool-1-thread-2,5,main] produce value: C85
Thread[pool-1-thread-1,5,main] poll value: C85
Thread[main,5,main] current size: 0
Thread[pool-1-thread-2,5,main] produce value: C86
Thread[pool-1-thread-1,5,main] poll value: C86
Thread[pool-1-thread-2,5,main] produce value: C87
Thread[pool-1-thread-1,5,main] poll value: C87
Thread[pool-1-thread-4,5,main] worker consume value: C77
Thread[pool-1-thread-4,5,main] worker consume value: C79
Thread[pool-1-thread-4,5,main] worker consume value: C78
Thread[pool-1-thread-4,5,main] worker consume value: C80
Thread[pool-1-thread-4,5,main] worker consume value: C85
Thread[pool-1-thread-4,5,main] worker consume value: C83
Thread[pool-1-thread-4,5,main] worker consume value: C86
Thread[pool-1-thread-4,5,main] worker consume value: C84
Thread[pool-1-thread-4,5,main] worker consume value: C87
Thread[pool-1-thread-4,5,main] worker consume value: C81
Thread[pool-1-thread-4,5,main] worker consume value: C82
Thread[main,5,main] current size: 0
Thread[pool-1-thread-2,5,main] produce value: C88
Thread[pool-1-thread-1,5,main] poll value: C88
Thread[pool-1-thread-2,5,main] produce value: C89
Thread[pool-1-thread-1,5,main] poll value: C89
Thread[main,5,main] current size: 0
Thread[pool-1-thread-2,5,main] produce value: C90
Thread[pool-1-thread-1,5,main] poll value: C90
Thread[pool-1-thread-2,5,main] produce value: C91
Thread[pool-1-thread-1,5,main] poll value: C91
Thread[main,5,main] current size: 0
Thread[pool-1-thread-2,5,main] produce value: C92
Thread[pool-1-thread-1,5,main] poll value: C92
Thread[pool-1-thread-2,5,main] produce value: C93
Thread[pool-1-thread-1,5,main] poll value: C93
Thread[main,5,main] current size: 0
Thread[pool-1-thread-2,5,main] produce value: C94
Thread[pool-1-thread-1,5,main] poll value: C94
Thread[pool-1-thread-2,5,main] produce value: C95
Thread[pool-1-thread-1,5,main] poll value: C95
Thread[main,5,main] current size: 0
Thread[pool-1-thread-2,5,main] produce value: C96
Thread[pool-1-thread-1,5,main] poll value: C96
Thread[pool-1-thread-2,5,main] produce value: C97
Thread[pool-1-thread-1,5,main] poll value: C97
Thread[main,5,main] current size: 0
Thread[pool-1-thread-2,5,main] produce value: C98
Thread[pool-1-thread-1,5,main] poll value: C98
Thread[pool-1-thread-5,5,main] worker consume value: C93
Thread[pool-1-thread-5,5,main] worker consume value: C92
Thread[pool-1-thread-5,5,main] worker consume value: C95
Thread[pool-1-thread-5,5,main] worker consume value: C94
Thread[pool-1-thread-5,5,main] worker consume value: C91
Thread[pool-1-thread-5,5,main] worker consume value: C90
Thread[pool-1-thread-5,5,main] worker consume value: C89
Thread[pool-1-thread-5,5,main] worker consume value: C98
Thread[pool-1-thread-5,5,main] worker consume value: C96
Thread[pool-1-thread-5,5,main] worker consume value: C97
Thread[pool-1-thread-5,5,main] worker consume value: C88
Thread[pool-1-thread-2,5,main] produce value: C99
Thread[pool-1-thread-1,5,main] poll value: C99
Thread[main,5,main] current size: 0
Thread[pool-1-thread-2,5,main] produce value: A0
Thread[pool-1-thread-1,5,main] poll value: A0
Thread[pool-1-thread-2,5,main] produce value: A1
Thread[pool-1-thread-1,5,main] poll value: A1
Thread[main,5,main] current size: 0
Thread[pool-1-thread-2,5,main] produce value: A2
Thread[pool-1-thread-1,5,main] poll value: A2
Thread[pool-1-thread-2,5,main] produce value: A3
Thread[pool-1-thread-1,5,main] poll value: A3
Thread[main,5,main] current size: 0
Thread[pool-1-thread-2,5,main] produce value: A4
Thread[pool-1-thread-1,5,main] poll value: A4
Thread[pool-1-thread-2,5,main] produce value: A5
Thread[pool-1-thread-1,5,main] poll value: A5
Thread[main,5,main] current size: 0
Thread[pool-1-thread-2,5,main] produce value: A6
Thread[pool-1-thread-1,5,main] poll value: A6
Thread[pool-1-thread-2,5,main] produce value: A7
Thread[pool-1-thread-1,5,main] poll value: A7
Thread[main,5,main] current size: 0
Thread[pool-1-thread-2,5,main] produce value: A8
Thread[pool-1-thread-1,5,main] poll value: A8
Thread[pool-1-thread-2,5,main] produce value: A9
Thread[pool-1-thread-1,5,main] poll value: A9
Thread[pool-1-thread-3,5,main] worker consume value: A2
Thread[pool-1-thread-3,5,main] worker consume value: A1
Thread[pool-1-thread-3,5,main] worker consume value: A4
Thread[pool-1-thread-3,5,main] worker consume value: A3
Thread[pool-1-thread-3,5,main] worker consume value: A6
Thread[pool-1-thread-3,5,main] worker consume value: A5
Thread[pool-1-thread-3,5,main] worker consume value: A8
Thread[pool-1-thread-3,5,main] worker consume value: A7
Thread[pool-1-thread-3,5,main] worker consume value: A9
Thread[pool-1-thread-3,5,main] worker consume value: C99
Thread[pool-1-thread-3,5,main] worker consume value: A0
Thread[main,5,main] current size: 0
Thread[pool-1-thread-2,5,main] produce value: A10
Thread[pool-1-thread-1,5,main] poll value: A10
Thread[pool-1-thread-2,5,main] produce value: A11
Thread[pool-1-thread-1,5,main] poll value: A11
Thread[main,5,main] current size: 0
Thread[pool-1-thread-2,5,main] produce value: A12
Thread[pool-1-thread-1,5,main] poll value: A12
Thread[pool-1-thread-2,5,main] produce value: A13
Thread[pool-1-thread-1,5,main] poll value: A13
Thread[main,5,main] current size: 0
Thread[pool-1-thread-2,5,main] produce value: A14
Thread[pool-1-thread-1,5,main] poll value: A14
Thread[pool-1-thread-2,5,main] produce value: A15
Thread[pool-1-thread-1,5,main] poll value: A15
Thread[main,5,main] current size: 0
Thread[pool-1-thread-2,5,main] produce value: A16
Thread[pool-1-thread-1,5,main] poll value: A16
Thread[pool-1-thread-2,5,main] produce value: A17
Thread[pool-1-thread-1,5,main] poll value: A17
Thread[main,5,main] current size: 0
Thread[pool-1-thread-2,5,main] produce value: A18
Thread[pool-1-thread-1,5,main] poll value: A18
Thread[pool-1-thread-2,5,main] produce value: A19
Thread[pool-1-thread-1,5,main] poll value: A19
Thread[main,5,main] current size: 0
Thread[pool-1-thread-2,5,main] produce value: A20
Thread[pool-1-thread-1,5,main] poll value: A20
Thread[pool-1-thread-4,5,main] worker consume value: A19
Thread[pool-1-thread-4,5,main] worker consume value: A18
Thread[pool-1-thread-4,5,main] worker consume value: A20
Thread[pool-1-thread-4,5,main] worker consume value: A11
Thread[pool-1-thread-4,5,main] worker consume value: A10
Thread[pool-1-thread-4,5,main] worker consume value: A13
Thread[pool-1-thread-4,5,main] worker consume value: A12
Thread[pool-1-thread-4,5,main] worker consume value: A15
Thread[pool-1-thread-4,5,main] worker consume value: A14
Thread[pool-1-thread-4,5,main] worker consume value: A17
Thread[pool-1-thread-4,5,main] worker consume value: A16
Thread[pool-1-thread-2,5,main] produce value: A21
Thread[pool-1-thread-1,5,main] poll value: A21
Thread[main,5,main] current size: 0
Thread[pool-1-thread-2,5,main] produce value: A22
Thread[pool-1-thread-1,5,main] poll value: A22
Thread[pool-1-thread-2,5,main] produce value: A23
Thread[pool-1-thread-1,5,main] poll value: A23
Thread[main,5,main] current size: 0
Thread[pool-1-thread-2,5,main] produce value: A24
Thread[pool-1-thread-1,5,main] poll value: A24
Thread[pool-1-thread-2,5,main] produce value: A25
Thread[pool-1-thread-1,5,main] poll value: A25
Thread[main,5,main] current size: 0
Thread[pool-1-thread-2,5,main] produce value: A26
Thread[pool-1-thread-1,5,main] poll value: A26
Thread[pool-1-thread-2,5,main] produce value: A27
Thread[pool-1-thread-1,5,main] poll value: A27
Thread[main,5,main] current size: 0
Thread[pool-1-thread-2,5,main] produce value: A28
Thread[pool-1-thread-1,5,main] poll value: A28
Thread[pool-1-thread-2,5,main] produce value: A29
Thread[pool-1-thread-1,5,main] poll value: A29
Thread[main,5,main] current size: 0
Thread[pool-1-thread-2,5,main] produce value: A30
Thread[pool-1-thread-1,5,main] poll value: A30
Thread[pool-1-thread-2,5,main] produce value: A31
Thread[pool-1-thread-1,5,main] poll value: A31
Thread[pool-1-thread-5,5,main] worker consume value: A30
Thread[pool-1-thread-5,5,main] worker consume value: A31
Thread[pool-1-thread-5,5,main] worker consume value: A29
Thread[pool-1-thread-5,5,main] worker consume value: A28
Thread[pool-1-thread-5,5,main] worker consume value: A27
Thread[pool-1-thread-5,5,main] worker consume value: A26
Thread[pool-1-thread-5,5,main] worker consume value: A25
Thread[pool-1-thread-5,5,main] worker consume value: A24
Thread[pool-1-thread-5,5,main] worker consume value: A23
Thread[pool-1-thread-5,5,main] worker consume value: A22
Thread[pool-1-thread-5,5,main] worker consume value: A21
Thread[main,5,main] current size: 0
Thread[pool-1-thread-2,5,main] produce value: A32
Thread[pool-1-thread-1,5,main] poll value: A32
Thread[pool-1-thread-2,5,main] produce value: A33
Thread[pool-1-thread-1,5,main] poll value: A33
Thread[main,5,main] current size: 0
Thread[pool-1-thread-2,5,main] produce value: A34
Thread[pool-1-thread-1,5,main] poll value: A34
Thread[pool-1-thread-2,5,main] produce value: A35
Thread[pool-1-thread-1,5,main] poll value: A35
Thread[main,5,main] current size: 0
Thread[pool-1-thread-2,5,main] produce value: A36
Thread[pool-1-thread-1,5,main] poll value: A36
Thread[pool-1-thread-2,5,main] produce value: A37
Thread[pool-1-thread-1,5,main] poll value: A37
Thread[main,5,main] current size: 0
Thread[pool-1-thread-2,5,main] produce value: A38
Thread[pool-1-thread-1,5,main] poll value: A38
Thread[pool-1-thread-2,5,main] produce value: A39
Thread[pool-1-thread-1,5,main] poll value: A39
Thread[main,5,main] current size: 0
Thread[pool-1-thread-2,5,main] produce value: A40
Thread[pool-1-thread-1,5,main] poll value: A40
Thread[pool-1-thread-2,5,main] produce value: A41
Thread[pool-1-thread-1,5,main] poll value: A41
Thread[main,5,main] current size: 0
Thread[pool-1-thread-2,5,main] produce value: A42
Thread[pool-1-thread-1,5,main] poll value: A42
Thread[pool-1-thread-3,5,main] worker consume value: A40
Thread[pool-1-thread-3,5,main] worker consume value: A41
Thread[pool-1-thread-3,5,main] worker consume value: A42
Thread[pool-1-thread-3,5,main] worker consume value: A37
Thread[pool-1-thread-3,5,main] worker consume value: A36
Thread[pool-1-thread-3,5,main] worker consume value: A39
Thread[pool-1-thread-3,5,main] worker consume value: A38
Thread[pool-1-thread-3,5,main] worker consume value: A33
Thread[pool-1-thread-3,5,main] worker consume value: A32
Thread[pool-1-thread-3,5,main] worker consume value: A35
Thread[pool-1-thread-3,5,main] worker consume value: A34
Thread[pool-1-thread-2,5,main] produce value: A43
Thread[pool-1-thread-1,5,main] poll value: A43
Thread[main,5,main] current size: 0
Thread[pool-1-thread-2,5,main] produce value: A44
Thread[pool-1-thread-1,5,main] poll value: A44
Thread[pool-1-thread-2,5,main] produce value: A45
Thread[pool-1-thread-1,5,main] poll value: A45
Thread[main,5,main] current size: 0
Thread[pool-1-thread-2,5,main] produce value: A46
Thread[pool-1-thread-1,5,main] poll value: A46
Thread[pool-1-thread-2,5,main] produce value: A47
Thread[pool-1-thread-1,5,main] poll value: A47
Thread[main,5,main] current size: 0
Thread[pool-1-thread-2,5,main] produce value: A48
Thread[pool-1-thread-1,5,main] poll value: A48
Thread[pool-1-thread-2,5,main] produce value: A49
Thread[pool-1-thread-1,5,main] poll value: A49
Thread[main,5,main] current size: 0
Thread[pool-1-thread-2,5,main] produce value: A50
Thread[pool-1-thread-1,5,main] poll value: A50
Thread[pool-1-thread-2,5,main] produce value: A51
Thread[pool-1-thread-1,5,main] poll value: A51
Thread[main,5,main] current size: 0
Thread[pool-1-thread-2,5,main] produce value: A52
Thread[pool-1-thread-1,5,main] poll value: A52
Thread[pool-1-thread-2,5,main] produce value: A53
Thread[pool-1-thread-1,5,main] poll value: A53
Thread[pool-1-thread-4,5,main] worker consume value: A45
Thread[pool-1-thread-4,5,main] worker consume value: A46
Thread[pool-1-thread-4,5,main] worker consume value: A43
Thread[pool-1-thread-4,5,main] worker consume value: A44
Thread[pool-1-thread-4,5,main] worker consume value: A49
Thread[pool-1-thread-4,5,main] worker consume value: A47
Thread[pool-1-thread-4,5,main] worker consume value: A48
Thread[pool-1-thread-4,5,main] worker consume value: A53
Thread[pool-1-thread-4,5,main] worker consume value: A52
Thread[pool-1-thread-4,5,main] worker consume value: A51
Thread[pool-1-thread-4,5,main] worker consume value: A50
Thread[main,5,main] current size: 0
Thread[pool-1-thread-2,5,main] produce value: A54
Thread[pool-1-thread-1,5,main] poll value: A54
Thread[pool-1-thread-2,5,main] produce value: A55
Thread[pool-1-thread-1,5,main] poll value: A55
Thread[main,5,main] current size: 0
Thread[pool-1-thread-2,5,main] produce value: A56
Thread[pool-1-thread-1,5,main] poll value: A56
Thread[pool-1-thread-2,5,main] produce value: A57
Thread[pool-1-thread-1,5,main] poll value: A57
Thread[main,5,main] current size: 0
Thread[pool-1-thread-2,5,main] produce value: A58
Thread[pool-1-thread-1,5,main] poll value: A58
Thread[pool-1-thread-2,5,main] produce value: A59
Thread[pool-1-thread-1,5,main] poll value: A59
Thread[main,5,main] current size: 0
Thread[pool-1-thread-2,5,main] produce value: A60
Thread[pool-1-thread-1,5,main] poll value: A60
Thread[pool-1-thread-2,5,main] produce value: A61
Thread[pool-1-thread-1,5,main] poll value: A61
Thread[main,5,main] current size: 0
Thread[pool-1-thread-2,5,main] produce value: A62
Thread[pool-1-thread-1,5,main] poll value: A62
Thread[pool-1-thread-2,5,main] produce value: A63
Thread[pool-1-thread-1,5,main] poll value: A63
Thread[main,5,main] current size: 0
Thread[pool-1-thread-2,5,main] produce value: A64
Thread[pool-1-thread-1,5,main] poll value: A64
Thread[pool-1-thread-5,5,main] worker consume value: A54
Thread[pool-1-thread-5,5,main] worker consume value: A55
Thread[pool-1-thread-5,5,main] worker consume value: A56
Thread[pool-1-thread-5,5,main] worker consume value: A57
Thread[pool-1-thread-5,5,main] worker consume value: A58
Thread[pool-1-thread-5,5,main] worker consume value: A59
Thread[pool-1-thread-5,5,main] worker consume value: A60
Thread[pool-1-thread-5,5,main] worker consume value: A62
Thread[pool-1-thread-5,5,main] worker consume value: A61
Thread[pool-1-thread-5,5,main] worker consume value: A64
Thread[pool-1-thread-5,5,main] worker consume value: A63
Thread[pool-1-thread-2,5,main] produce value: A65
Thread[pool-1-thread-1,5,main] poll value: A65
Thread[main,5,main] current size: 0
Thread[pool-1-thread-2,5,main] produce value: A66
Thread[pool-1-thread-1,5,main] poll value: A66
Thread[pool-1-thread-2,5,main] produce value: A67
Thread[pool-1-thread-1,5,main] poll value: A67
Thread[main,5,main] current size: 0
Thread[pool-1-thread-2,5,main] produce value: A68
Thread[pool-1-thread-1,5,main] poll value: A68
Thread[pool-1-thread-2,5,main] produce value: A69
Thread[pool-1-thread-1,5,main] poll value: A69
Thread[main,5,main] current size: 0
Thread[pool-1-thread-2,5,main] produce value: A70
Thread[pool-1-thread-1,5,main] poll value: A70
Thread[pool-1-thread-2,5,main] produce value: A71
Thread[pool-1-thread-1,5,main] poll value: A71
Thread[main,5,main] current size: 0
Thread[pool-1-thread-2,5,main] produce value: A72
Thread[pool-1-thread-1,5,main] poll value: A72
Thread[pool-1-thread-2,5,main] produce value: A73
Thread[pool-1-thread-1,5,main] poll value: A73
Thread[main,5,main] current size: 0
Thread[pool-1-thread-2,5,main] produce value: A74
Thread[pool-1-thread-1,5,main] poll value: A74
Thread[pool-1-thread-2,5,main] produce value: A75
Thread[pool-1-thread-1,5,main] poll value: A75
Thread[pool-1-thread-3,5,main] worker consume value: A69
Thread[pool-1-thread-3,5,main] worker consume value: A67
Thread[pool-1-thread-3,5,main] worker consume value: A68
Thread[pool-1-thread-3,5,main] worker consume value: A65
Thread[pool-1-thread-3,5,main] worker consume value: A66
Thread[pool-1-thread-3,5,main] worker consume value: A75
Thread[pool-1-thread-3,5,main] worker consume value: A74
Thread[pool-1-thread-3,5,main] worker consume value: A73
Thread[pool-1-thread-3,5,main] worker consume value: A72
Thread[pool-1-thread-3,5,main] worker consume value: A71
Thread[pool-1-thread-3,5,main] worker consume value: A70
Thread[main,5,main] current size: 0
Thread[pool-1-thread-2,5,main] produce value: A76
Thread[pool-1-thread-1,5,main] poll value: A76
Thread[pool-1-thread-2,5,main] produce value: A77
Thread[pool-1-thread-1,5,main] poll value: A77
Thread[main,5,main] current size: 0
Thread[pool-1-thread-2,5,main] produce value: A78
Thread[pool-1-thread-1,5,main] poll value: A78
Thread[pool-1-thread-2,5,main] produce value: A79
Thread[pool-1-thread-1,5,main] poll value: A79
Thread[main,5,main] current size: 0
Thread[pool-1-thread-2,5,main] produce value: A80
Thread[pool-1-thread-1,5,main] poll value: A80
Thread[pool-1-thread-2,5,main] produce value: A81
Thread[pool-1-thread-1,5,main] poll value: A81
Thread[main,5,main] current size: 0
Thread[pool-1-thread-2,5,main] produce value: A82
Thread[pool-1-thread-1,5,main] poll value: A82
Thread[pool-1-thread-2,5,main] produce value: A83
Thread[pool-1-thread-1,5,main] poll value: A83
Thread[main,5,main] current size: 0
Thread[pool-1-thread-2,5,main] produce value: A84
Thread[pool-1-thread-1,5,main] poll value: A84
Thread[pool-1-thread-2,5,main] produce value: A85
Thread[pool-1-thread-1,5,main] poll value: A85
Thread[main,5,main] current size: 0
Thread[pool-1-thread-2,5,main] produce value: A86
Thread[pool-1-thread-1,5,main] poll value: A86
Thread[pool-1-thread-4,5,main] worker consume value: A76
Thread[pool-1-thread-4,5,main] worker consume value: A77
Thread[pool-1-thread-4,5,main] worker consume value: A78
Thread[pool-1-thread-4,5,main] worker consume value: A79
Thread[pool-1-thread-4,5,main] worker consume value: A84
Thread[pool-1-thread-4,5,main] worker consume value: A83
Thread[pool-1-thread-4,5,main] worker consume value: A86
Thread[pool-1-thread-4,5,main] worker consume value: A85
Thread[pool-1-thread-4,5,main] worker consume value: A80
Thread[pool-1-thread-4,5,main] worker consume value: A82
Thread[pool-1-thread-4,5,main] worker consume value: A81
Thread[pool-1-thread-2,5,main] produce value: A87
Thread[pool-1-thread-1,5,main] poll value: A87
Thread[main,5,main] current size: 0
Thread[pool-1-thread-2,5,main] produce value: A88
Thread[pool-1-thread-1,5,main] poll value: A88
Thread[pool-1-thread-2,5,main] produce value: A89
Thread[pool-1-thread-1,5,main] poll value: A89
Thread[main,5,main] current size: 0
Thread[pool-1-thread-2,5,main] produce value: A90
Thread[pool-1-thread-1,5,main] poll value: A90
Thread[pool-1-thread-2,5,main] produce value: A91
Thread[pool-1-thread-1,5,main] poll value: A91
Thread[main,5,main] current size: 0
Thread[pool-1-thread-2,5,main] produce value: A92
Thread[pool-1-thread-1,5,main] poll value: A92
Thread[pool-1-thread-2,5,main] produce value: A93
Thread[pool-1-thread-1,5,main] poll value: A93
Thread[main,5,main] current size: 0
Thread[pool-1-thread-2,5,main] produce value: A94
Thread[pool-1-thread-1,5,main] poll value: A94
Thread[pool-1-thread-2,5,main] produce value: A95
Thread[pool-1-thread-1,5,main] poll value: A95
Thread[main,5,main] current size: 0
Thread[pool-1-thread-2,5,main] produce value: A96
Thread[pool-1-thread-1,5,main] poll value: A96
Thread[pool-1-thread-2,5,main] produce value: A97
Thread[pool-1-thread-1,5,main] poll value: A97
Thread[pool-1-thread-5,5,main] worker consume value: A90
Thread[pool-1-thread-5,5,main] worker consume value: A91
Thread[pool-1-thread-5,5,main] worker consume value: A92
Thread[pool-1-thread-5,5,main] worker consume value: A93
Thread[pool-1-thread-5,5,main] worker consume value: A94
Thread[pool-1-thread-5,5,main] worker consume value: A95
Thread[pool-1-thread-5,5,main] worker consume value: A96
Thread[pool-1-thread-5,5,main] worker consume value: A97
Thread[pool-1-thread-5,5,main] worker consume value: A88
Thread[pool-1-thread-5,5,main] worker consume value: A87
Thread[pool-1-thread-5,5,main] worker consume value: A89
Thread[main,5,main] current size: 0
Thread[pool-1-thread-2,5,main] produce value: A98
Thread[pool-1-thread-1,5,main] poll value: A98
Thread[pool-1-thread-2,5,main] produce value: A99
Thread[pool-1-thread-1,5,main] poll value: A99
Thread[main,5,main] current size: 0
Thread[pool-1-thread-2,5,main] produce value: A0
Thread[pool-1-thread-1,5,main] poll value: A0
Thread[pool-1-thread-2,5,main] produce value: A1
Thread[pool-1-thread-1,5,main] poll value: A1
Thread[main,5,main] current size: 0
Thread[pool-1-thread-2,5,main] produce value: A2
Thread[pool-1-thread-1,5,main] poll value: A2
Thread[pool-1-thread-2,5,main] produce value: A3
Thread[pool-1-thread-1,5,main] poll value: A3
Thread[main,5,main] current size: 0
Thread[pool-1-thread-2,5,main] produce value: A4
Thread[pool-1-thread-1,5,main] poll value: A4
Thread[pool-1-thread-2,5,main] produce value: A5
Thread[pool-1-thread-1,5,main] poll value: A5
Thread[main,5,main] current size: 0
Thread[pool-1-thread-2,5,main] produce value: A6
Thread[pool-1-thread-1,5,main] poll value: A6
Thread[pool-1-thread-2,5,main] produce value: A7
Thread[pool-1-thread-1,5,main] poll value: A7
Thread[main,5,main] current size: 0
Thread[pool-1-thread-2,5,main] produce value: A8
Thread[pool-1-thread-1,5,main] poll value: A8
Thread[pool-1-thread-3,5,main] worker consume value: A2
Thread[pool-1-thread-3,5,main] worker consume value: A1
Thread[pool-1-thread-3,5,main] worker consume value: A4
Thread[pool-1-thread-3,5,main] worker consume value: A3
Thread[pool-1-thread-3,5,main] worker consume value: A6
Thread[pool-1-thread-3,5,main] worker consume value: A5
Thread[pool-1-thread-3,5,main] worker consume value: A8
Thread[pool-1-thread-3,5,main] worker consume value: A7
Thread[pool-1-thread-3,5,main] worker consume value: A99
Thread[pool-1-thread-3,5,main] worker consume value: A98
Thread[pool-1-thread-3,5,main] worker consume value: A0
Thread[pool-1-thread-2,5,main] produce value: A9
Thread[pool-1-thread-1,5,main] poll value: A9
Thread[main,5,main] current size: 0
Thread[pool-1-thread-2,5,main] produce value: A10
Thread[pool-1-thread-1,5,main] poll value: A10
Thread[pool-1-thread-2,5,main] produce value: A11
Thread[pool-1-thread-1,5,main] poll value: A11
Thread[main,5,main] current size: 0
Thread[pool-1-thread-2,5,main] produce value: A12
Thread[pool-1-thread-1,5,main] poll value: A12
Thread[pool-1-thread-2,5,main] produce value: A13
Thread[pool-1-thread-1,5,main] poll value: A13
Thread[main,5,main] current size: 0
Thread[pool-1-thread-2,5,main] produce value: A14
Thread[pool-1-thread-1,5,main] poll value: A14
Thread[pool-1-thread-2,5,main] produce value: A15
Thread[pool-1-thread-1,5,main] poll value: A15
Thread[main,5,main] current size: 0
Thread[pool-1-thread-2,5,main] produce value: A16
Thread[pool-1-thread-1,5,main] poll value: A16
Thread[pool-1-thread-2,5,main] produce value: A17
Thread[pool-1-thread-1,5,main] poll value: A17
Thread[main,5,main] current size: 0
Thread[pool-1-thread-2,5,main] produce value: A18
Thread[pool-1-thread-1,5,main] poll value: A18
Thread[pool-1-thread-2,5,main] produce value: A19
Thread[pool-1-thread-1,5,main] poll value: A19
Thread[pool-1-thread-4,5,main] worker consume value: A19
Thread[pool-1-thread-4,5,main] worker consume value: A18
Thread[pool-1-thread-4,5,main] worker consume value: A11
Thread[pool-1-thread-4,5,main] worker consume value: A10
Thread[pool-1-thread-4,5,main] worker consume value: A9
Thread[pool-1-thread-4,5,main] worker consume value: A13
Thread[pool-1-thread-4,5,main] worker consume value: A12
Thread[pool-1-thread-4,5,main] worker consume value: A15
Thread[pool-1-thread-4,5,main] worker consume value: A14
Thread[pool-1-thread-4,5,main] worker consume value: A17
Thread[pool-1-thread-4,5,main] worker consume value: A16
Thread[main,5,main] current size: 0
Thread[pool-1-thread-2,5,main] produce value: A20
Thread[pool-1-thread-1,5,main] poll value: A20
Thread[pool-1-thread-2,5,main] produce value: A21
Thread[pool-1-thread-1,5,main] poll value: A21
Thread[main,5,main] current size: 0
Thread[pool-1-thread-2,5,main] produce value: A22
Thread[pool-1-thread-1,5,main] poll value: A22
Thread[pool-1-thread-2,5,main] produce value: A23
Thread[pool-1-thread-1,5,main] poll value: A23
Thread[main,5,main] current size: 0
Thread[pool-1-thread-2,5,main] produce value: A24
Thread[pool-1-thread-1,5,main] poll value: A24
Thread[pool-1-thread-2,5,main] produce value: A25
Thread[pool-1-thread-1,5,main] poll value: A25
Thread[main,5,main] current size: 0
Thread[pool-1-thread-2,5,main] produce value: A26
Thread[pool-1-thread-1,5,main] poll value: A26
Thread[pool-1-thread-2,5,main] produce value: A27
Thread[pool-1-thread-1,5,main] poll value: A27
Thread[main,5,main] current size: 0
Thread[pool-1-thread-2,5,main] produce value: A28
Thread[pool-1-thread-1,5,main] poll value: A28
Thread[pool-1-thread-2,5,main] produce value: A29
Thread[pool-1-thread-1,5,main] poll value: A29
Thread[main,5,main] current size: 0
Thread[pool-1-thread-2,5,main] produce value: A30
Thread[pool-1-thread-1,5,main] poll value: A30
Thread[pool-1-thread-5,5,main] worker consume value: A30
Thread[pool-1-thread-5,5,main] worker consume value: A29
Thread[pool-1-thread-5,5,main] worker consume value: A20
Thread[pool-1-thread-5,5,main] worker consume value: A28
Thread[pool-1-thread-5,5,main] worker consume value: A27
Thread[pool-1-thread-5,5,main] worker consume value: A26
Thread[pool-1-thread-5,5,main] worker consume value: A25
Thread[pool-1-thread-5,5,main] worker consume value: A24
Thread[pool-1-thread-5,5,main] worker consume value: A23
Thread[pool-1-thread-5,5,main] worker consume value: A22
Thread[pool-1-thread-5,5,main] worker consume value: A21
Thread[pool-1-thread-2,5,main] produce value: A31
Thread[pool-1-thread-1,5,main] poll value: A31
Thread[main,5,main] current size: 0
Thread[pool-1-thread-2,5,main] produce value: A32
Thread[pool-1-thread-1,5,main] poll value: A32
Thread[pool-1-thread-2,5,main] produce value: A33
Thread[pool-1-thread-1,5,main] poll value: A33
Thread[main,5,main] current size: 0
Thread[pool-1-thread-2,5,main] produce value: A34
Thread[pool-1-thread-1,5,main] poll value: A34
Thread[pool-1-thread-2,5,main] produce value: A35
Thread[pool-1-thread-1,5,main] poll value: A35
Thread[main,5,main] current size: 0
Thread[pool-1-thread-2,5,main] produce value: A36
Thread[pool-1-thread-1,5,main] poll value: A36
Thread[pool-1-thread-2,5,main] produce value: A37
Thread[pool-1-thread-1,5,main] poll value: A37
Thread[main,5,main] current size: 0
Thread[pool-1-thread-2,5,main] produce value: A38
Thread[pool-1-thread-1,5,main] poll value: A38
Thread[pool-1-thread-2,5,main] produce value: A39
Thread[pool-1-thread-1,5,main] poll value: A39
Thread[main,5,main] current size: 0
Thread[pool-1-thread-2,5,main] produce value: A40
Thread[pool-1-thread-1,5,main] poll value: A40
Thread[pool-1-thread-2,5,main] produce value: A41
Thread[pool-1-thread-1,5,main] poll value: A41
Thread[pool-1-thread-3,5,main] worker consume value: A40
Thread[pool-1-thread-3,5,main] worker consume value: A31
Thread[pool-1-thread-3,5,main] worker consume value: A41
Thread[pool-1-thread-3,5,main] worker consume value: A37
Thread[pool-1-thread-3,5,main] worker consume value: A36
Thread[pool-1-thread-3,5,main] worker consume value: A39
Thread[pool-1-thread-3,5,main] worker consume value: A38
Thread[pool-1-thread-3,5,main] worker consume value: A33
Thread[pool-1-thread-3,5,main] worker consume value: A32
Thread[pool-1-thread-3,5,main] worker consume value: A35
Thread[pool-1-thread-3,5,main] worker consume value: A34
Thread[main,5,main] current size: 0
Thread[pool-1-thread-2,5,main] produce value: A42
Thread[pool-1-thread-1,5,main] poll value: A42
Thread[pool-1-thread-2,5,main] produce value: A43
Thread[pool-1-thread-1,5,main] poll value: A43
Thread[main,5,main] current size: 0
Thread[pool-1-thread-2,5,main] produce value: A44
Thread[pool-1-thread-1,5,main] poll value: A44
Thread[pool-1-thread-2,5,main] produce value: A45
Thread[pool-1-thread-1,5,main] poll value: A45
Thread[main,5,main] current size: 0
Thread[pool-1-thread-2,5,main] produce value: A46
Thread[pool-1-thread-1,5,main] poll value: A46
Thread[pool-1-thread-2,5,main] produce value: A47
Thread[pool-1-thread-1,5,main] poll value: A47
Thread[main,5,main] current size: 0
Thread[pool-1-thread-2,5,main] produce value: A48
Thread[pool-1-thread-1,5,main] poll value: A48
Thread[pool-1-thread-2,5,main] produce value: A49
Thread[pool-1-thread-1,5,main] poll value: A49
Thread[main,5,main] current size: 0
Thread[pool-1-thread-2,5,main] produce value: A50
Thread[pool-1-thread-1,5,main] poll value: A50
Thread[pool-1-thread-2,5,main] produce value: A51
Thread[pool-1-thread-1,5,main] poll value: A51
Thread[pool-1-thread-2,5,main] produce value: A52
Thread[pool-1-thread-1,5,main] poll value: A52
Thread[pool-1-thread-4,5,main] worker consume value: A45
Thread[pool-1-thread-4,5,main] worker consume value: A46
Thread[pool-1-thread-4,5,main] worker consume value: A43
Thread[pool-1-thread-4,5,main] worker consume value: A44
Thread[pool-1-thread-4,5,main] worker consume value: A42
Thread[pool-1-thread-4,5,main] worker consume value: A49
Thread[pool-1-thread-4,5,main] worker consume value: A47
Thread[pool-1-thread-4,5,main] worker consume value: A48
Thread[pool-1-thread-4,5,main] worker consume value: A52
Thread[pool-1-thread-4,5,main] worker consume value: A51
Thread[pool-1-thread-4,5,main] worker consume value: A50
Thread[main,5,main] current size: 0
Thread[pool-1-thread-2,5,main] produce value: A53
Thread[pool-1-thread-1,5,main] poll value: A53
Thread[pool-1-thread-2,5,main] produce value: A54
Thread[pool-1-thread-1,5,main] poll value: A54
Thread[main,5,main] current size: 0
Thread[pool-1-thread-2,5,main] produce value: A55
Thread[pool-1-thread-1,5,main] poll value: A55
Thread[pool-1-thread-2,5,main] produce value: A56
Thread[pool-1-thread-1,5,main] poll value: A56
Thread[main,5,main] current size: 0
Thread[pool-1-thread-2,5,main] produce value: A57
Thread[pool-1-thread-1,5,main] poll value: A57
Thread[pool-1-thread-2,5,main] produce value: A58
Thread[pool-1-thread-1,5,main] poll value: A58
Thread[main,5,main] current size: 0
Thread[pool-1-thread-2,5,main] produce value: A59
Thread[pool-1-thread-1,5,main] poll value: A59
Thread[pool-1-thread-2,5,main] produce value: A60
Thread[pool-1-thread-1,5,main] poll value: A60
Thread[main,5,main] current size: 0
Thread[pool-1-thread-2,5,main] produce value: A61
Thread[pool-1-thread-1,5,main] poll value: A61
Thread[pool-1-thread-2,5,main] produce value: A62
Thread[pool-1-thread-1,5,main] poll value: A62
Thread[main,5,main] current size: 0
Thread[pool-1-thread-2,5,main] produce value: A63
Thread[pool-1-thread-1,5,main] poll value: A63
Thread[pool-1-thread-5,5,main] worker consume value: A54
Thread[pool-1-thread-5,5,main] worker consume value: A55
Thread[pool-1-thread-5,5,main] worker consume value: A56
Thread[pool-1-thread-5,5,main] worker consume value: A57
Thread[pool-1-thread-5,5,main] worker consume value: A58
Thread[pool-1-thread-5,5,main] worker consume value: A59
Thread[pool-1-thread-5,5,main] worker consume value: A60
Thread[pool-1-thread-5,5,main] worker consume value: A62
Thread[pool-1-thread-5,5,main] worker consume value: A53
Thread[pool-1-thread-5,5,main] worker consume value: A61
Thread[pool-1-thread-5,5,main] worker consume value: A63
Thread[pool-1-thread-2,5,main] produce value: A64
Thread[pool-1-thread-1,5,main] poll value: A64
Thread[main,5,main] current size: 0
Thread[pool-1-thread-2,5,main] produce value: A65
Thread[pool-1-thread-1,5,main] poll value: A65
Thread[pool-1-thread-2,5,main] produce value: A66
Thread[pool-1-thread-1,5,main] poll value: A66
Thread[main,5,main] current size: 0
Thread[pool-1-thread-2,5,main] produce value: A67
Thread[pool-1-thread-1,5,main] poll value: A67
Thread[pool-1-thread-2,5,main] produce value: A68
Thread[pool-1-thread-1,5,main] poll value: A68
Thread[main,5,main] current size: 0
Thread[pool-1-thread-2,5,main] produce value: A69
Thread[pool-1-thread-1,5,main] poll value: A69
Thread[pool-1-thread-2,5,main] produce value: A70
Thread[pool-1-thread-1,5,main] poll value: A70
Thread[main,5,main] current size: 0
Thread[pool-1-thread-2,5,main] produce value: A71
Thread[pool-1-thread-1,5,main] poll value: A71
Thread[pool-1-thread-2,5,main] produce value: A72
Thread[pool-1-thread-1,5,main] poll value: A72
Thread[main,5,main] current size: 0
Thread[pool-1-thread-2,5,main] produce value: A73
Thread[pool-1-thread-1,5,main] poll value: A73
Thread[pool-1-thread-2,5,main] produce value: A74
Thread[pool-1-thread-1,5,main] poll value: A74
Thread[pool-1-thread-3,5,main] worker consume value: A69
Thread[pool-1-thread-3,5,main] worker consume value: A67
Thread[pool-1-thread-3,5,main] worker consume value: A68
Thread[pool-1-thread-3,5,main] worker consume value: A65
Thread[pool-1-thread-3,5,main] worker consume value: A66
Thread[pool-1-thread-3,5,main] worker consume value: A74
Thread[pool-1-thread-3,5,main] worker consume value: A73
Thread[pool-1-thread-3,5,main] worker consume value: A72
Thread[pool-1-thread-3,5,main] worker consume value: A71
Thread[pool-1-thread-3,5,main] worker consume value: A70
Thread[pool-1-thread-3,5,main] worker consume value: A64
Thread[main,5,main] current size: 0
Thread[pool-1-thread-2,5,main] produce value: A75
Thread[pool-1-thread-1,5,main] poll value: A75
Thread[pool-1-thread-2,5,main] produce value: A76
Thread[pool-1-thread-1,5,main] poll value: A76
Thread[main,5,main] current size: 0
Thread[pool-1-thread-2,5,main] produce value: A77
Thread[pool-1-thread-1,5,main] poll value: A77
Thread[pool-1-thread-2,5,main] produce value: A78
Thread[pool-1-thread-1,5,main] poll value: A78
Thread[main,5,main] current size: 0
Thread[pool-1-thread-2,5,main] produce value: A79
Thread[pool-1-thread-1,5,main] poll value: A79
Thread[pool-1-thread-2,5,main] produce value: A80
Thread[pool-1-thread-1,5,main] poll value: A80
Thread[main,5,main] current size: 0
Thread[pool-1-thread-2,5,main] produce value: A81
Thread[pool-1-thread-1,5,main] poll value: A81
Thread[pool-1-thread-2,5,main] produce value: A82
Thread[pool-1-thread-1,5,main] poll value: A82
Thread[main,5,main] current size: 0
Thread[pool-1-thread-2,5,main] produce value: A83
Thread[pool-1-thread-1,5,main] poll value: A83
Thread[pool-1-thread-2,5,main] produce value: A84
Thread[pool-1-thread-1,5,main] poll value: A84
Thread[main,5,main] current size: 0
Thread[pool-1-thread-2,5,main] produce value: A85
Thread[pool-1-thread-1,5,main] poll value: A85
Thread[pool-1-thread-4,5,main] worker consume value: A76
Thread[pool-1-thread-4,5,main] worker consume value: A77
Thread[pool-1-thread-4,5,main] worker consume value: A78
Thread[pool-1-thread-4,5,main] worker consume value: A79
Thread[pool-1-thread-4,5,main] worker consume value: A84
Thread[pool-1-thread-4,5,main] worker consume value: A75
Thread[pool-1-thread-4,5,main] worker consume value: A83
Thread[pool-1-thread-4,5,main] worker consume value: A85
Thread[pool-1-thread-4,5,main] worker consume value: A80
Thread[pool-1-thread-4,5,main] worker consume value: A82
Thread[pool-1-thread-4,5,main] worker consume value: A81
Thread[pool-1-thread-2,5,main] produce value: A86
Thread[pool-1-thread-1,5,main] poll value: A86
Thread[main,5,main] current size: 0
Thread[pool-1-thread-2,5,main] produce value: A87
Thread[pool-1-thread-1,5,main] poll value: A87
Thread[pool-1-thread-2,5,main] produce value: A88
Thread[pool-1-thread-1,5,main] poll value: A88
Thread[main,5,main] current size: 0
Thread[pool-1-thread-2,5,main] produce value: A89
Thread[pool-1-thread-1,5,main] poll value: A89
Thread[pool-1-thread-2,5,main] produce value: A90
Thread[pool-1-thread-1,5,main] poll value: A90
Thread[main,5,main] current size: 0
Thread[pool-1-thread-2,5,main] produce value: A91
Thread[pool-1-thread-1,5,main] poll value: A91
Thread[pool-1-thread-2,5,main] produce value: A92
Thread[pool-1-thread-1,5,main] poll value: A92
Thread[main,5,main] current size: 0
Thread[pool-1-thread-2,5,main] produce value: A93
Thread[pool-1-thread-1,5,main] poll value: A93
Thread[pool-1-thread-2,5,main] produce value: A94
Thread[pool-1-thread-1,5,main] poll value: A94
Thread[main,5,main] current size: 0
Thread[pool-1-thread-2,5,main] produce value: A95
Thread[pool-1-thread-1,5,main] poll value: A95
Thread[pool-1-thread-2,5,main] produce value: A96
Thread[pool-1-thread-1,5,main] poll value: A96
Thread[pool-1-thread-5,5,main] worker consume value: A90
Thread[pool-1-thread-5,5,main] worker consume value: A91
Thread[pool-1-thread-5,5,main] worker consume value: A92
Thread[pool-1-thread-5,5,main] worker consume value: A93
Thread[pool-1-thread-5,5,main] worker consume value: A94
Thread[pool-1-thread-5,5,main] worker consume value: A95
Thread[pool-1-thread-5,5,main] worker consume value: A96
Thread[pool-1-thread-5,5,main] worker consume value: A88
Thread[pool-1-thread-5,5,main] worker consume value: A87
Thread[pool-1-thread-5,5,main] worker consume value: A86
Thread[pool-1-thread-5,5,main] worker consume value: A89
Thread[main,5,main] current size: 0
Thread[pool-1-thread-2,5,main] produce value: A97
Thread[pool-1-thread-1,5,main] poll value: A97
Thread[pool-1-thread-2,5,main] produce value: A98
Thread[pool-1-thread-1,5,main] poll value: A98
Thread[main,5,main] current size: 0
Thread[pool-1-thread-2,5,main] produce value: A99
Thread[pool-1-thread-1,5,main] poll value: A99
Thread[pool-1-thread-2,5,main] produce value: A0
Thread[pool-1-thread-1,5,main] poll value: A0
Thread[main,5,main] current size: 0
Thread[pool-1-thread-2,5,main] produce value: A1
Thread[pool-1-thread-1,5,main] poll value: A1
Thread[pool-1-thread-2,5,main] produce value: A2
Thread[pool-1-thread-1,5,main] poll value: A2
Thread[main,5,main] current size: 0
Thread[pool-1-thread-2,5,main] produce value: A3
Thread[pool-1-thread-1,5,main] poll value: A3
Thread[pool-1-thread-2,5,main] produce value: A4
Thread[pool-1-thread-1,5,main] poll value: A4
Thread[main,5,main] current size: 0
Thread[pool-1-thread-2,5,main] produce value: A5
Thread[pool-1-thread-1,5,main] poll value: A5
Thread[pool-1-thread-2,5,main] produce value: A6
Thread[pool-1-thread-1,5,main] poll value: A6
Thread[main,5,main] current size: 0
Thread[pool-1-thread-2,5,main] produce value: A7
Thread[pool-1-thread-1,5,main] poll value: A7
Thread[pool-1-thread-3,5,main] worker consume value: A2
Thread[pool-1-thread-3,5,main] worker consume value: A1
Thread[pool-1-thread-3,5,main] worker consume value: A4
Thread[pool-1-thread-3,5,main] worker consume value: A3
Thread[pool-1-thread-3,5,main] worker consume value: A6
Thread[pool-1-thread-3,5,main] worker consume value: A5
Thread[pool-1-thread-3,5,main] worker consume value: A7
Thread[pool-1-thread-3,5,main] worker consume value: A97
Thread[pool-1-thread-3,5,main] worker consume value: A99
Thread[pool-1-thread-3,5,main] worker consume value: A98
Thread[pool-1-thread-3,5,main] worker consume value: A0
Thread[pool-1-thread-2,5,main] produce value: A8
Thread[pool-1-thread-1,5,main] poll value: A8
Thread[main,5,main] current size: 0
Thread[pool-1-thread-2,5,main] produce value: A9
Thread[pool-1-thread-1,5,main] poll value: A9
Thread[pool-1-thread-2,5,main] produce value: A10
Thread[pool-1-thread-1,5,main] poll value: A10
Thread[main,5,main] current size: 0
Thread[pool-1-thread-2,5,main] produce value: A11
Thread[pool-1-thread-1,5,main] poll value: A11
Thread[pool-1-thread-2,5,main] produce value: A12
Thread[pool-1-thread-1,5,main] poll value: A12
Thread[main,5,main] current size: 0
Thread[pool-1-thread-2,5,main] produce value: A13
Thread[pool-1-thread-1,5,main] poll value: A13
Thread[pool-1-thread-2,5,main] produce value: A14
Thread[pool-1-thread-1,5,main] poll value: A14
Thread[main,5,main] current size: 0
Thread[pool-1-thread-2,5,main] produce value: A15
Thread[pool-1-thread-1,5,main] poll value: A15
Thread[pool-1-thread-2,5,main] produce value: A16
Thread[pool-1-thread-1,5,main] poll value: A16
Thread[main,5,main] current size: 0
Thread[pool-1-thread-2,5,main] produce value: A17
Thread[pool-1-thread-1,5,main] poll value: A17
Thread[pool-1-thread-2,5,main] produce value: A18
Thread[pool-1-thread-1,5,main] poll value: A18
Thread[pool-1-thread-4,5,main] worker consume value: A18
Thread[pool-1-thread-4,5,main] worker consume value: A8
Thread[pool-1-thread-4,5,main] worker consume value: A11
Thread[pool-1-thread-4,5,main] worker consume value: A10
Thread[pool-1-thread-4,5,main] worker consume value: A9
Thread[pool-1-thread-4,5,main] worker consume value: A13
Thread[pool-1-thread-4,5,main] worker consume value: A12
Thread[pool-1-thread-4,5,main] worker consume value: A15
Thread[pool-1-thread-4,5,main] worker consume value: A14
Thread[pool-1-thread-4,5,main] worker consume value: A17
Thread[pool-1-thread-4,5,main] worker consume value: A16
Thread[main,5,main] current size: 0
Thread[pool-1-thread-2,5,main] produce value: A19
Thread[pool-1-thread-1,5,main] poll value: A19
Thread[pool-1-thread-2,5,main] produce value: A20
Thread[pool-1-thread-1,5,main] poll value: A20
Thread[main,5,main] current size: 0
Thread[pool-1-thread-2,5,main] produce value: A21
Thread[pool-1-thread-1,5,main] poll value: A21
Thread[pool-1-thread-2,5,main] produce value: A22
Thread[pool-1-thread-1,5,main] poll value: A22
Thread[main,5,main] current size: 0
Thread[pool-1-thread-2,5,main] produce value: A23
Thread[pool-1-thread-1,5,main] poll value: A23
Thread[pool-1-thread-2,5,main] produce value: A24
Thread[pool-1-thread-1,5,main] poll value: A24
Thread[main,5,main] current size: 0
Thread[pool-1-thread-2,5,main] produce value: A25
Thread[pool-1-thread-1,5,main] poll value: A25
Thread[pool-1-thread-2,5,main] produce value: A26
Thread[pool-1-thread-1,5,main] poll value: A26
Thread[main,5,main] current size: 0
Thread[pool-1-thread-2,5,main] produce value: A27
Thread[pool-1-thread-1,5,main] poll value: A27
Thread[pool-1-thread-2,5,main] produce value: A28
Thread[pool-1-thread-1,5,main] poll value: A28
Thread[main,5,main] current size: 0
Thread[pool-1-thread-2,5,main] produce value: A29
Thread[pool-1-thread-1,5,main] poll value: A29
Thread[pool-1-thread-5,5,main] worker consume value: A19
Thread[pool-1-thread-5,5,main] worker consume value: A29
Thread[pool-1-thread-5,5,main] worker consume value: A20
Thread[pool-1-thread-5,5,main] worker consume value: A28
Thread[pool-1-thread-5,5,main] worker consume value: A27
Thread[pool-1-thread-5,5,main] worker consume value: A26
Thread[pool-1-thread-5,5,main] worker consume value: A25
Thread[pool-1-thread-5,5,main] worker consume value: A24
Thread[pool-1-thread-5,5,main] worker consume value: A23
Thread[pool-1-thread-5,5,main] worker consume value: A22
Thread[pool-1-thread-5,5,main] worker consume value: A21
Thread[pool-1-thread-2,5,main] produce value: A30
Thread[pool-1-thread-1,5,main] poll value: A30
Thread[main,5,main] current size: 0
Thread[pool-1-thread-2,5,main] produce value: A31
Thread[pool-1-thread-1,5,main] poll value: A31
Thread[pool-1-thread-2,5,main] produce value: A32
Thread[pool-1-thread-1,5,main] poll value: A32
Thread[main,5,main] current size: 0
Thread[pool-1-thread-2,5,main] produce value: A33
Thread[pool-1-thread-1,5,main] poll value: A33
Thread[pool-1-thread-2,5,main] produce value: A34
Thread[pool-1-thread-1,5,main] poll value: A34
Thread[main,5,main] current size: 0
Thread[pool-1-thread-2,5,main] produce value: A35
Thread[pool-1-thread-1,5,main] poll value: A35
Thread[pool-1-thread-2,5,main] produce value: A36
Thread[pool-1-thread-1,5,main] poll value: A36
Thread[main,5,main] current size: 0
Thread[pool-1-thread-2,5,main] produce value: A37
Thread[pool-1-thread-1,5,main] poll value: A37
Thread[pool-1-thread-2,5,main] produce value: A38
Thread[pool-1-thread-1,5,main] poll value: A38
Thread[main,5,main] current size: 0

生产都消费者模式的一个demo,消费者设置缓存的更多相关文章

  1. 生产者消费者模式做一个golang的定时器

    在主程序启动的时候开一个goroutine作为消费者,用管道连接生产者和消费者,消费者处于无限循环,从管道中获取channel传过来定时event 注意:channel在消费者创建的时候就连通生产者和 ...

  2. Lucene.net站内搜索—4、搜索引擎第一版技术储备(简单介绍Log4Net、生产者消费者模式)

    目录 Lucene.net站内搜索—1.SEO优化 Lucene.net站内搜索—2.Lucene.Net简介和分词Lucene.net站内搜索—3.最简单搜索引擎代码Lucene.net站内搜索—4 ...

  3. python 并发编程 锁 / 信号量 / 事件 / 队列(进程间通信(IPC)) /生产者消费者模式

    (1)锁:进程之间数据不共享,但是共享同一套文件系统,所以访问同一个文件,或同一个打印终端,是没有问题的,而共享带来的是竞争,竞争带来的结果就是错乱,如何控制,就是加锁处理. 虽然使用加锁的形式实现了 ...

  4. Java实现多线程生产者消费者模式的两种方法

    生产者消费者模式:生产者和消费者在同一时间段内共用同一存储空间,生产者向空间里生产数据,而消费者取走数据.生产者生产一个,消费者消费一个,不断循环. 第一种实现方法,用BlockingQueue阻塞队 ...

  5. java多线程系列15 设计模式 生产者 - 消费者模式

    生产者-消费者 生产者消费者模式是一个非常经典的多线程模式,比如我们用到的Mq就是其中一种具体实现 在该模式中 通常会有2类线程,消费者线程和生产者线程 生产者提交用户请求 消费者负责处理生产者提交的 ...

  6. Java多线程-----实现生产者消费者模式的几种方式

       1 生产者消费者模式概述 生产者消费者模式就是通过一个容器来解决生产者和消费者的强耦合问题.生产者和消费者彼此之间不直接通讯,而通过阻塞队列来进行通讯,所以生产者生产完数据之后不用等待消费者处理 ...

  7. Java的设计模式(7)— 生产者-消费者模式

    生产者-消费者模式是一个经典的多线程设计模式,它为多线程间的协作提供了良好的解决方案.这个模式中,通常有两类线程,即若干个生产者线程和若干个消费者线程.生产者线程负责提交用户请求,消费者线程则负责具体 ...

  8. Java并发程序设计(十一)设计模式与并发之生产者-消费者模式

    设计模式与并发之生产者-消费者模式 生产者-消费者模式是一个经典的多线程设计模式.它为多线程间的协作提供了良好的解决方案.在生产者-消费者模式中,通常由两类线程,即若干个生产者线程和若干个消费者线程. ...

  9. RabbitMQ下的生产消费者模式与订阅发布模式

    所谓模式,就是在某种场景下,一类问题及其解决方案的总结归纳.生产消费者模式与订阅发布模式是使用消息中间件时常用的两种模式,用于功能解耦和分布式系统间的消息通信,以下面两种场景为例: 数据接入   假设 ...

随机推荐

  1. Eclipse扩展点实践之添加快捷菜单项(Command方式实现)

    有两种方式,一种是Action的方式,另一种是Command的方式(这两种方式的区别详见:http://wiki.eclipse.org/FAQ_What_is_the_difference_betw ...

  2. WP8中的地图和导航

    原文 WP8中的地图和导航 代码示例 源文件: Media:MapSample.zip 测试基于 SDK: Windows Phone SDK 8.0 兼容于 平台: Windows Phone 8 ...

  3. 【Cloud Foundry】Could Foundry学习(三)——Router

    在阅读的过程中有不论什么问题.欢迎一起交流 邮箱:1494713801@qq.com    QQ:1494713801 一.概述 Router组件在Cloud Foundry中是对全部进来的Reque ...

  4. hdu 4836 The Query on the Tree(线段树or树状数组)

    The Query on the Tree Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Ot ...

  5. 【转】C# String.Format数字格式化输出各种转换{0:N2} {0:D2} {0:C2}...

    ; //格式为sring输出 // Label1.Text = string.Format("asdfadsf{0}adsfasdf",a); // Label2.Text = & ...

  6. 利用Javamail接收QQ邮箱和Gmail邮箱(转)

    求大神解答 Java代码: public class SendMailController { //@Autowired private JavaMailSenderImpl mailSender; ...

  7. 一个css和js结合的下拉菜单,支持主流浏览器

    首先声明: 本人尽管在web前端岗位干了好多年,但无奈岗位对技术要求不高.html,css用的比較多,JavaScript自己原创的非常少,基本都是copy改动,所以自己真正动手写时,发现基础非常不坚 ...

  8. MySQL 批量Dll操作(转)

    概述 本章节介绍使用游标来批量进行表操作,包括批量添加索引.批量添加字段等.如果对存储过程.变量定义.预处理还不是很熟悉先阅读我前面写过的关于这三个概念的文章,只有先了解了这三个概念才能更好的理解这篇 ...

  9. tcpdump VS tshark用法(转)

    Tcpdump是网络协议分析的基本工具.tshark是大名鼎鼎的开源网络协议分析工具wireshark (原名叫ethereal)的命令行版本,wireshark可对多达千余种网络协议进行解码分析.W ...

  10. 活动图(Activity Diagram) - 项目分解文章

    案例基础上登录用户进行操作的每个模块. 1. 员 (1) 列车顺序表 (2) 货车装卸报告(数据处理) (3) 货车装卸报告(查看) 2. 管理员 (1) password管理 (2) 查看日志 (3 ...