Appending and prepending to a static sort is concurrent friendly.

I'm rather fond of this double-lock approach (despite the risk of deadlocking).
A write mutex guards all write operations at a coarse level - trying to append
concurrently will be serialized. While a read write mutex is used precisely
when manipulating the data structures. The result, I think, is the ability
to serialize expensive writes which only block reads when absolutely
necessary.