Modify Thread class, add ByteChannel class and MemBlock struct.