// File: /workspace/github_cpp_makefile_star2_O3/renbozqin[P]blocking_queue/test.cpp
// Function: main
int main(int argc, char* argv[]){

	BlockingQueue<int> queue;
	BlockingQueue<int> queue2;

	double st = getMS();
	std::thread t1(thread1<int>,std::ref(queue));
	std::thread t2(thread2<int>,std::ref(queue),std::ref(queue2));
	std::thread t3(thread3<int>,std::ref(queue2));

	t1.join();
	t2.join();
	t3.join();
	double et = getMS();
	std::cout << "Muil threads use time: " << et-st << "ms" << std::endl;

	st = getMS();
	thread1(queue);
	thread2(queue,queue2);
	thread3(queue2);
	et = getMS();
	std::cout << "Single thread use time: " << et-st << "ms" << std::endl;

	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x200, %rsp            # imm = 0x200
leaq -0x218(%rbp), %r14
movq %r14, %rdi
callq 0x2736
leaq -0x138(%rbp), %rbx
movq %rbx, %rdi
callq 0x2736
leaq -0x58(%rbp), %r15
movq %r15, %rdi
xorl %esi, %esi
callq 0x21c0
cvtsi2sdq (%r15), %xmm0
movsd %xmm0, -0x38(%rbp)
xorps %xmm0, %xmm0
cvtsi2sdq 0x8(%r15), %xmm0
movsd %xmm0, -0x30(%rbp)
movq %r14, (%r15)
leaq 0x38b(%rip), %rsi       # 0x27d7
leaq -0x48(%rbp), %rdi
leaq -0x58(%rbp), %rdx
callq 0x2844
leaq -0x58(%rbp), %rdx
movq %r14, (%rdx)
leaq -0x28(%rbp), %rcx
movq %rbx, (%rcx)
leaq 0x454(%rip), %rsi       # 0x28c2
leaq -0x40(%rbp), %rdi
callq 0x294c
leaq -0x58(%rbp), %rdx
movq %rbx, (%rdx)
leaq 0x556(%rip), %rsi       # 0x29db
leaq -0x28(%rbp), %rdi
callq 0x2844
leaq -0x48(%rbp), %rdi
callq 0x2200
leaq -0x40(%rbp), %rdi
callq 0x2200
leaq -0x28(%rbp), %rdi
callq 0x2200
leaq -0x58(%rbp), %rbx
movq %rbx, %rdi
xorl %esi, %esi
callq 0x21c0
movq (%rbx), %r14
movq 0x8(%rbx), %rbx
movq 0x5b13(%rip), %rdi      # 0x7fd8
leaq 0x2b44(%rip), %rsi      # 0x5010
movl $0x17, %edx
callq 0x2160
movsd 0x2b2a(%rip), %xmm2     # 0x5008
movsd -0x30(%rbp), %xmm0
divsd %xmm2, %xmm0
movsd -0x38(%rbp), %xmm3
mulsd %xmm2, %xmm3
addsd %xmm0, %xmm3
xorps %xmm0, %xmm0
cvtsi2sd %r14, %xmm0
cvtsi2sd %rbx, %xmm1
divsd %xmm2, %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
subsd %xmm3, %xmm0
movq 0x5ac0(%rip), %rdi      # 0x7fd8
callq 0x21b0
movq %rax, %rbx
leaq 0x2b01(%rip), %rsi      # 0x5028
movl $0x2, %edx
movq %rax, %rdi
callq 0x2160
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2140
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20e0
leaq -0x58(%rbp), %rbx
movq %rbx, %rdi
xorl %esi, %esi
callq 0x21c0
xorps %xmm0, %xmm0
cvtsi2sdq (%rbx), %xmm0
movsd %xmm0, -0x38(%rbp)
xorps %xmm0, %xmm0
cvtsi2sdq 0x8(%rbx), %xmm0
movsd %xmm0, -0x30(%rbp)
leaq -0x218(%rbp), %rdi
callq 0x27d7
leaq -0x218(%rbp), %rbx
leaq -0x138(%rbp), %rsi
movq %rbx, %rdi
callq 0x28c2
leaq -0x138(%rbp), %r14
movq %r14, %rdi
callq 0x29db
movq %r15, %rdi
xorl %esi, %esi
callq 0x21c0
movq (%r15), %r12
movq 0x8(%r15), %r15
movq 0x5a0b(%rip), %rdi      # 0x7fd8
leaq 0x2a57(%rip), %rsi      # 0x502b
movl $0x18, %edx
callq 0x2160
movsd 0x2a22(%rip), %xmm2     # 0x5008
movsd -0x30(%rbp), %xmm0
divsd %xmm2, %xmm0
movsd -0x38(%rbp), %xmm3
mulsd %xmm2, %xmm3
addsd %xmm0, %xmm3
xorps %xmm0, %xmm0
cvtsi2sd %r12, %xmm0
cvtsi2sd %r15, %xmm1
divsd %xmm2, %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
subsd %xmm3, %xmm0
movq 0x59b8(%rip), %rdi      # 0x7fd8
callq 0x21b0
movq %rax, %r15
leaq 0x29f9(%rip), %rsi      # 0x5028
movl $0x2, %edx
movq %rax, %rdi
callq 0x2160
movq (%r15), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x2140
movsbl %al, %esi
movq %r15, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20e0
cmpq $0x0, -0x28(%rbp)
jne 0x2730
cmpq $0x0, -0x40(%rbp)
jne 0x2730
cmpq $0x0, -0x48(%rbp)
jne 0x2730
movl $0x88, %r15d
addq %r15, %r14
movq %r14, %rdi
callq 0x2a86
leaq -0xe0(%rbp), %rdi
callq 0x2220
leaq -0x110(%rbp), %rdi
callq 0x2220
addq %r15, %rbx
movq %rbx, %rdi
callq 0x2a86
leaq -0x1c0(%rbp), %rdi
callq 0x2220
leaq -0x1f0(%rbp), %rdi
callq 0x2220
xorl %eax, %eax
addq $0x200, %rsp            # imm = 0x200
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0x2702
movq %rax, %rbx
jmp 0x2709
movq %rax, %rbx
jmp 0x2710
movq %rax, %rbx
jmp 0x271c
jmp 0x26f8
movq %rax, %rbx
cmpq $0x0, -0x28(%rbp)
jne 0x2730
cmpq $0x0, -0x40(%rbp)
jne 0x2730
cmpq $0x0, -0x48(%rbp)
jne 0x2730
leaq -0x138(%rbp), %rdi
callq 0x2a48
leaq -0x218(%rbp), %rdi
callq 0x2a48
movq %rbx, %rdi
callq 0x2210
callq 0x2050
nop