PDA

View Full Version : Threading with rsh and rcp



jaxrpc
4th June 2010, 10:39
HI,

i have a function that does a rsh into a remote machine and copy files from that remote machine to another machine using rcp. The function takes along time to finish if there are alot of files to copy or when an connection a refused.

I figured i might need to create a new thread to call my function so that it will not hindle the rest of the application. I tried creating a thread but it seems to be blocking the whole application till the rsh + rcp is done.

But i get a memory fault when i try to run my thread and the whole program crashes. Not sure if i am doing things right..any other alternative to my problem? thanks



P_Thread *pr_thread = new P_Thread;
pr_thread->message(msg);

pr_thread->start();

squidge
4th June 2010, 11:11
I'm assuming you'll be using QProcess for executing the commands, so I don't see why a thread is needed at all. It can be done using an event loop and signals?

jaxrpc
4th June 2010, 11:50
hi,

i am using system() calls;

oh i didn't know there's a QProcess. I will go read up on it.
thanks