Using pthread.h, now able to assign all instances that are on the same thread to the same write buffer. This allows me to remove all the mute_exes previously locking the write buffers, resulting in a significant performance increase! Now only locking using global mute_ex, and only using this in perform routine around read/write from/to read buffers.