PriorityBlockingQueue
全部标签前言可以通过分析PriorityBlockingQueue来了解JUC中的线程安全的队列实现的一些套路,这些套路会在JUC中其他数据结构实现上反复出现,从而可以更合理的了解那些实现机制背后通用的部分。BlockingQueueAQueuethatadditionallysupportsoperationsthatwaitforthequeuetobecomenon-emptywhenretrievinganelement,andwaitforspacetobecomeavailableinthequeuewhenstoringanelement.阻塞队列,这个接口就非常重要,它是定义了阻塞队列
前言可以通过分析PriorityBlockingQueue来了解JUC中的线程安全的队列实现的一些套路,这些套路会在JUC中其他数据结构实现上反复出现,从而可以更合理的了解那些实现机制背后通用的部分。BlockingQueueAQueuethatadditionallysupportsoperationsthatwaitforthequeuetobecomenon-emptywhenretrievinganelement,andwaitforspacetobecomeavailableinthequeuewhenstoringanelement.阻塞队列,这个接口就非常重要,它是定义了阻塞队列