simulate process with c