merge read and write threads into one server