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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T22:12:10+00:00 2026-05-13T22:12:10+00:00

A snippet from Managed Threading Best Practices on MSDN: Don’t control the execution of

  • 0

A snippet from Managed Threading Best Practices on MSDN:

Don’t control the execution of worker threads from your main program (using events, for example). Instead, design your program so that worker threads are responsible for waiting until work is available, executing it, and notifying other parts of your program when finished. If your worker threads do not block, consider using thread pool threads. Monitor..::.PulseAll is useful in situations where worker threads block.

I want to know what this describes so I can search for basic implementations to start working with.

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

    What the snippet means is that:

    Suppose you have a producer-consumer problem for which you have a consumer thread. If you have a dedicated thread(non ThreadPool) then you should use the WaitHandle::WaitOne call to make that thread wait until you have something to process (maybe in a process queue). When the producer is done filling up the queue, it can call WaitHandle::Set() to notify you thread to start processing the queue. WaitOne() is for dedicated threads because it will be expensive to create a new dedicated thread every time you want to process the queue.

    DoProcessQueue()
    {
        while(RUNTHREAD)
        {
            ... process queue items
    
            waitHandle.WaitOne(); // will wiat here until producer thread calls Set()
        }
    }
    

    ThreadPool threads are recommended for small tasks so if you plan to use WaitOne() then you should not use ThreadPool threads because ThreadPool is a global resource available to every application and blocking the pool threads is not a good option.

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

Sidebar

Related Questions

Snippet from a SQL query (using SQL Server 2008 R2): , CONVERT (VARCHAR(10), s.ENTER_DATE,
Snippet from deploy.rb task :prod1 do set :deploy_to, /home/project/src/prod1 end task :prod2 do set
This snippet from official website works as expected: $treeObject = Doctrine::getTable('Category')->getTree(); $rootColumnName = $treeObject->getAttribute('rootColumnName');
This is a little snippet from a little flash game I'm working on: This
This is a code snippet from O'Reilly Learning Opencv, cvNamedWindow(Example3, CV_WINDOW_AUTOSIZE); g_capture = cvCreateFileCapture(argv[1]);
Here's a snippet from my application: class PortolioItem(models.Model): ... user = models.ForeignKey(User) contract =
I have the following snippet from my code: switch ($extention) { case gif: $src
Below is a code snippet from a book. Why can serialNumber still be set
Here is a snippet from a Sinatra app where users will be submitting urls.
Here is a code snippet from my project: template<typename Second, typename First = const

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.