I understand that having a thread sucking for elements of a BlockingQueue
using the take()
method will wait for an element to be available (unless it is interrupted).
I have two questions:
i) Is the thread automatically woken-up as soon as an element becomes available or is there a delay (i.e., the thread checks itself later)?
ii) If there is a delay, does it make sense to wake up the thread (by interrupting it explicitly for example)? I am thinking about latency and performance.