read and split files based with race condition