What do you mean by 'two processes running at teh same time'. Do you mean your client and server run at the same time? If so just run each of them seperatly.
You dont' need threads for any of what you are doing and threads are quite complex and will only make things worse. Look up select as I already suggested, and please be more complete in what you mean by "two processes running at the same time".