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

  • Home
  • SEARCH
  • 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 6736157
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T11:05:49+00:00 2026-05-26T11:05:49+00:00

I have a main processes that will create 4 threads. If i simply run

  • 0

I have a main processes that will create 4 threads. If i simply run all 4 threads would the kernel utilize all 4 cores or will the program be multithreaded on a single core? if not then how would synchronization be handled on a multicore. I have a 4core intel cpu and my program is in c++

Im running this on a linux in a Virtual machine.

  • 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-05-26T11:05:49+00:00Added an answer on May 26, 2026 at 11:05 am

    You don’t really know.

    For one thing, the C++03 Standard doesn’t know anything about threads, cores or any of that kind of stuff. So this is all platform-dependant anyway.

    But even from a platform point-of-view, you often still don’t really know. The operating system schedules threads and jobs. The OS might — or might not — give you the means to specify a “processor affinity” for a particular thread, but this typically takes some hoop-jumping-through to utilize.

    One of the things you also should keep in mind is that if your goal is to keep each core 100% utilized, you’ll often need more than n threads (where n is number of cores). Threads spend a lot of time sleeping, waiting on disk, and generally not doing anything on the core. The exact number of threads you’ll need depends on your actual application and platform, but experimentation can help guide you towards fine tuning this.

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

Sidebar

Related Questions

I have a main program which creates a collection of N child threads to
I'm trying to create a progress bar that will work asynchronously to the main
I have main table called 'Employee' and another slave table called 'EmployeeTypes' that has
I have a main table that I must get data from. I have a
I have one 'main' thread that creates an array of objects of class SlowData
We have an application that creates several threads using the pthread library. As we
I have a Delphi 6 application that receives and processes an image stream from
I'm trying to create a C++ dynamic library that won't have a class. I'd
So I have an application which uses threads. Now when the program first starts
I have perused all related threads on SO but still confused about how to

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.