Results 1 to 3 of 3

Thread: Threading with rsh and rcp

  1. #1
    Join Date
    May 2010
    Posts
    12
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Threading with rsh and rcp

    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

    Qt Code:
    1. P_Thread *pr_thread = new P_Thread;
    2. pr_thread->message(msg);
    3.  
    4. pr_thread->start();
    To copy to clipboard, switch view to plain text mode 

  2. #2
    Join Date
    Sep 2009
    Location
    UK
    Posts
    2,447
    Thanks
    6
    Thanked 348 Times in 333 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Threading with rsh and rcp

    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?

  3. #3
    Join Date
    May 2010
    Posts
    12
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Threading with rsh and rcp

    hi,

    i am using system() calls;

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

Similar Threads

  1. Multi-threading
    By lixo1 in forum Qt Programming
    Replies: 5
    Last Post: 22nd June 2009, 13:22
  2. Qt threading question..
    By tgreaves in forum Qt Programming
    Replies: 2
    Last Post: 23rd January 2009, 12:00
  3. Threading...?
    By sekatsim in forum Qt Programming
    Replies: 12
    Last Post: 10th June 2008, 01:14
  4. Qt Threading
    By avh in forum Newbie
    Replies: 7
    Last Post: 30th May 2008, 20:20
  5. Sub-Threading
    By TheGrimace in forum Qt Programming
    Replies: 4
    Last Post: 7th June 2007, 16:38

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.