working shell with c++ threads