Are LinkedBlockingQueue's insert and remove methods thread safe?
Posted
by Steve Kuo
on Stack Overflow
See other posts from Stack Overflow
or by Steve Kuo
Published on 2010-04-23T00:23:53Z
Indexed on
2010/04/23
0:33 UTC
Read the original article
Hit count: 658
I'm using LinkedBlockingQueue
between two different threads. One thread adds data via add
, while the other thread receives data via take
.
My question is, do I need to synchronize access to add
and take
. Is LinkedBlockingQueue
's insert and remove methods thread safe?
© Stack Overflow or respective owner