add ipc and thread , but thread is not safe