sample of send/rcv using thread