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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T19:13:11+00:00 2026-05-23T19:13:11+00:00

There is a CreateThread() call within a for loop, and I want all the

  • 0

There is a CreateThread() call within a for loop, and I want all the threads to be launched one after another and each thread writes data to a object.

      `$while (ii != mapOServs.end())
{
      Array_of_Thread_Handles[i] = CreateThread(NULL,0,MyThread, &args[i] , 0 , NULL);
    }

But the threads don’t start until it hits WaitForMultipleObjects or WaitForSingleObject.

How do I make all the threads run one after another without waiting for a response?

Also, what is the best object to use so that it can be modified by different threads at the same time.

  • 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-23T19:13:12+00:00Added an answer on May 23, 2026 at 7:13 pm

    The threads are indeed “started” immediately — Windows will create the necessary internal structures, allocate the stack and so forth, and add them to the scheduler’s run list. However, they won’t necessarily be scheduled immediately.

    In particular, the thread doing the launching will likely keep running until it has used up its time slice. If you have more threads running than processor cores (including threads in other processes), then your new threads may well not be scheduled on a processor for a while, and your thread doing the launching may execute up to a synchronization call such as WaitForSingleObject before any of them have had a chance to do any work.

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

Sidebar

Related Questions

I want to create a thread for some db writes that should not block
I have a Java class called CreateThread which creates one thread, everytime an object
There are two popular closure styles in javascript. The first I call anonymous constructor
There are several types of objects in a system, and each has it's own
Anything wrong with this in general? CallingFunction() { CreatePipe() CreateMutex() CreateThread( ThreadFunction ) while(there
This is the code to create a thread_group and execute all threads in parallel:
I have the following situation main() { hnd = CreateTHread( func1 ); // Call
What's a better way to start a thread, _beginthread , _beginthreadx or CreateThread ?
Good day all, for running multiple threads concurrently is it advisable to create different
In my application, I am performing my file reading by another thread(other than the

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.