Buffer threadsafe rearranged