From: Adam Prescott Date: 2013-03-16T23:34:43+09:00 Subject: Re: control the concurrent thread numbers On 16 March 2013 14:24, Ken Paul wrote: > You are right, I'm trying to consume the array simultaneously. But after > I move the join out of loop, it still has problem. How to fix it? Every thread is executing code wrapped in a mutex, so only one thread will be able to #shift the array. As Joel said, what's the problem you're really trying to solve?