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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T02:01:13+00:00 2026-05-20T02:01:13+00:00

Im using Generic.Queue in C# 3.0 and Monitor.Enter,wait,exit for wait before consuming the queue

  • 0

Im using Generic.Queue in C# 3.0 and Monitor.Enter,wait,exit for wait before consuming the queue (wait for the element to be enqueued). Now im moving to C# 4.

Can anyone suggest me which one is fast and best especially to avoid locks..

BlockingCollection vs concurrentQueue or any thing else…

Note. I dont want to restrict my producer

Thanks in advance..

  • 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-20T02:01:13+00:00Added an answer on May 20, 2026 at 2:01 am

    BlockingCollection and ConcurrentQueue are there for precisely this reason. I doubt that you’ll find anything better, or simpler to use. The parallel extensions team know their stuff 🙂

    Just a quick check on versions though – you’re definitely using .NET 4, not just C# 4? (For example, you could be using Visual Studio 2010 and thus C# 4, but still targeting .NET 3.5, in which case you couldn’t use Parallel Extensions.)

    You may also want to start researching Task-Based Asynchronous Pattern, TPL Dataflow and the async/await features of C# 5… obviously you can’t use them just yet, but it doesn’t hurt to know what’s coming up.

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

Sidebar

Related Questions

using System; using System.Collections.Generic; using System.Collections.Specialized; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls;
I used this code: using System; using System.Collections.Generic; using System.ComponentModel; using System.Windows.Forms; using System.IO;
i edited my code to the following: using System; using System.Collections.Generic; using System.Linq; using
Using the C# code below, how would you write it in Visual Basic? What
I have the following classes: using System; using System.Windows.Forms; namespace FastEyeControl { public partial
I have recently tried to write an application in c# using EWS to read
I've been working on this school assignment. The assignment told us to make an
I am trying to replace the following: txt1.Text = txt2.Text = txt3.Text = txt4.text
I have the following static field in my class private static Func<IDataReader, Project> Make
Playing around with Dapper, I'm quite pleased with the results so far - intriguing!

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.