When we use one of the inbuilt queues like ConcurrentLinkedQueue or even some BlockingQueue, single calls are atomic and guaranteed to be thread safe. But when of the 5 calls to the API, 4 calls are single, but one call is of the form:
if(some condition)
{
queue.call();
}
This call needs to be in a synchronized block since this operations is non atomic. But doesn't introducing this call also means that all access to this queue, whether read or write should be synchronized from now on?
If yes, can I assume that once a single non atomic call creeps in the code, which is very likely, then all access to the fancy queue will have to be manually synchronized?