Is LinkedList thread-safe when I’m accessing it with offer and poll exclusively?

LinkedList is not thread safe. You’d have to do the locking yourself.

Try ConcurrentLinkedQueue or LinkedBlockingDeque instead if it fits your needs, they are thread safe but slightly different behavior than LinkedList.

Leave a Comment