DelayQueue is not Serializable?

Doug Lea dl at
Tue Sep 20 18:34:13 UTC 2011

On 09/20/11 12:29, Aleksey Shipilev wrote:
> Hi,
> I've been stumbled upon this for a bit.
> Is there any specific reason DelayQueue is not serializable? Or is it
> an API bug?
> The backing PriorityQueue *is* serializable.

It was a deliberate decision.
DelayQueues use relative times, so the delays don't make sense
when deserialized at an arbitrary time. And there's no way to
guarantee a correct clock resync to re-normalize.

Plus, no one has ever complained about this, so we
haven't ever revisited it.


More information about the core-libs-dev mailing list