Make structure writing as atomic operation