Tuesday, 28 April 2009

The Legacy Oswego Libraries and their Manifestation in Modern Day Java

The CopyOnWriteArrayList of Java 1.5 has its origins in the legendary Oswego by Doug Lea. This is a thread-safe ArrayList implemented by (expensively) copying the underlying array for every mutative operation. It implements the generic List interface ("sequence" interface).

Another oswego staple imported into 1.5 is the ThreadFactory, an object that creates new threads on demand. The newThread method takes a Runnable interface and returns a Thread.

No comments: