Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8795321
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T23:22:16+00:00 2026-06-13T23:22:16+00:00

I am running a piece of software that is very parallel. There are about

  • 0

I am running a piece of software that is very parallel. There are about 400 commands I need to run that don’t depend on each other at all, so I just fork them off and hope and that having more CPUs means more processes executed per unit time.

Code:

foreach cmd ($CMD_LIST)
    $cmd &    #fork it off
end

Very simple. Here are my testing results:

On 1 CPU, this takes 1006 seconds, or 16 mins 46 seconds.

With 10 CPUs, this took 600s, or 10 minutes!

Why wouldn’t the time taken divide (roughly) by 10? I feel cheated here =(

edit – of course I’m willing to provide additional details you would want to know, just not sure what’s relevant because in simplest terms this is what I’m doing.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T23:22:16+00:00Added an answer on June 13, 2026 at 11:22 pm

    You are assuming your processes are 100% CPU-bound.

    If your processes do any disk or network I/O, the bottleneck will be on those operations, which cannot be parallelised (eg one process will download a file at 100k/s, 2 processes at 50k/s each so you would not see any improvement at all, furthermore you could experience a degrade in performance because of overheads).

    See: Amdahl’s_law – this allows you to estimate the improvement in performance when parallelising tasks, knowing the proportion between the parallelisable part and the non-parallelisable)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a piece of the same software, running on 2 servers. Each of
I have a piece of running java software that is jammed. I would like
Scenario: There is a complex piece of software that is annoying to launch by
I have a piece of mature geospatial software that has recently had areas rewritten
I have a piece of server-ish software written in Java to run on Windows
Recently I've added some load-balancing capabilities to a piece of software that I wrote.
I'm writing a piece of honeypot software that will have extensive logging of interactions
I wrote a piece of software in Java that communicates with USB hardware by
While running through a piece of code for performance tuning, i noticed that the
Running SQL Server 2005. A piece of software integrates with our database. Unfortunately they

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.