Find the answer to your Linux question:
Results 1 to 3 of 3
Hi All, Am new to linux forums .. I would like to know which one is more optimized among the below two, 1) Fork + exec 2) system() system call ...
  1. #1
    Just Joined!
    Join Date
    May 2008
    Posts
    9

    Smile Optimized programming

    Hi All,
    Am new to linux forums .. I would like to know which one is more optimized among the below two,
    1) Fork + exec
    2) system() system call
    As per my knowledge fork+exec is better since i will be avoiding invocation of shell as the system() does. But still I would like to confirm it. Linux gurus out there, please help me.

    Thanks in advance

  2. #2
    Linux Engineer wje_lf's Avatar
    Join Date
    Sep 2007
    Location
    Mariposa
    Posts
    1,192
    You are correct. The fork/exec combination avoids the running of a shell, and is therefore faster (all other things being equal).
    --
    Bill

    Old age and treachery will overcome youth and skill.

  3. #3
    Just Joined!
    Join Date
    May 2008
    Posts
    9
    Quote Originally Posted by wje_lf View Post
    You are correct. The fork/exec combination avoids the running of a shell, and is therefore faster (all other things being equal).
    Thank you for ur response.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...