improved singleton and allocator
improved the implementation of Condition and CircularBuffer