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 8711541
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T04:54:11+00:00 2026-06-13T04:54:11+00:00

I’ve a core 2 duo processor. I want to create and run eight threads(that

  • 0

I’ve a core 2 duo processor.

I want to create and run eight threads(that have no shared data in between them) such that in any given time all eight will run once where thread 1 and thread 2 will run at the same time and if thread 1 and thread 2 can’t run simultaneously by the processor I want priority be given to thread 1 so that thread 1 will run before thread 2.

Similarly thread 3 and 4 can run concurrently but if thread 3 and thread 4 can’t run at the same time I want thread 3 to execute before thread 4 and not before thread 1 and 2 and not after thread 5 and 6 and thread 7 and thread 8.

Same for thread 5 and thread 6, thread 7 and thread 8.

After all 8 threads have finish their tasks the 8 threads will run again and again in the above given order until termination.

How can achieve this using c++ and visual studio 2008 on Windows 7?

Is it possible to implement this with c++?

  • 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-13T04:54:13+00:00Added an answer on June 13, 2026 at 4:54 am

    Ok, after a lot of wrangling to actually get the question out of you, here’s the version I’m going to try to answer:

    After creating threads it’s not guaranteed that any two threads will run simultaneously on a dual core processor. So if two threads don’t run simultaneously I want priority be given such that thread 1(created first) will run first and thread 2(created second) will always run after thread 1.

    And luckily, the answer to that is fairly simple. Your program doesn’t know which threads are run when. The OS doesn’t tell you when it starts and stops a thread, so you can’t code any kind of “is thread 1 running? If not, I’ll pause and let that run” check.

    But you can set the threads to have different priorities. That indicates to the OS which ones it should schedule for execution. Give your threads a gradually decreasing priority (so thread 1 has a high priority, thread 2 one step lower and so on), and you’ll have made something that kind of approximates what you want. On Windows, this might actually work out fairly well, since Windows always tries to pick the highest prioritized threads/processes available. Linux will try to ensure that all threads get some execution time, but will simply give more to higher prioritized ones.

    And of course, messing with priorities like this also affects how your program is scheduled in relation to everything else running on the PC. You’re really trying to go about this the wrong way, and the saner solution would be to simply find another scheme for parallelizing this.

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

Sidebar

Related Questions

I have a French site that I want to parse, but am running into
I have a small JavaScript validation script that validates inputs based on Regex. I
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I want to construct a data frame in an Rcpp function, but when I
I'm trying to create an if statement in PHP that prevents a single post
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and

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.