Thread: A thread calling a program

  1. #1
    Registered User
    Join Date
    Mar 2016

    A thread calling a program


    I need pthreads to execute another c program rather than a function how can I do that?

    Also I want the other threads to terminate if one of them terminated

  2. #2
    Registered User
    Join Date
    May 2013
    afaik, you can't.
    If "another c program" is not part of the binary of the running process, your only option is forking new child process, and mounting another_c_program's binary to it.

  3. #3
    Registered User
    Join Date
    Dec 2015
    You can do a system call and basically do something like a command line call.

    Then maybe kick off a thread seeing if that process is still going?

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 2
    Last Post: 01-18-2012, 12:27 AM
  2. Replies: 1
    Last Post: 03-03-2009, 04:47 PM
  3. problem calling a function from a thread
    By BrownB in forum Windows Programming
    Replies: 8
    Last Post: 12-13-2007, 07:55 PM
  4. Calling a Thread with a Function Pointer.
    By ScrollMaster in forum Windows Programming
    Replies: 6
    Last Post: 06-10-2006, 08:56 AM
  5. Thread calling convention
    By Sebastiani in forum A Brief History of
    Replies: 1
    Last Post: 05-28-2002, 07:50 PM