Please check the following link , this may help you. http://linuxcommand.org/man_pages/rdesktop1.html
You should always use SSH to connect a system remotely. SSH is a secure method that encrypts the entire session.
I know the basics of pthread but looking for more information on uses of pthread_detach library function.