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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T06:52:14+00:00 2026-05-11T06:52:14+00:00

Time and time again I find myself having to write thread-safe versions of BindingList

  • 0

Time and time again I find myself having to write thread-safe versions of BindingList and ObservableCollection because, when bound to UI, these controls cannot be changed from multiple threads. What I’m trying to understand is why this is the case – is it a design fault or is this behavior intentional?

  • 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. 2026-05-11T06:52:15+00:00Added an answer on May 11, 2026 at 6:52 am

    The problem is designing a thread safe collection is not simple. Sure it’s simple enough to design a collection which can be modified/read from multiple threads without corrupting state. But it’s much more difficult to design a collection that is usable given that it’s updated from multiple threads. Take the following code as an example.

    if ( myCollection.Count > 0 ) {   var x = myCollection[0]; } 

    Assume that myCollection is a thread safe collection where adds and updates are guaranteed not to corrupt state. This code is not thread safe and is a race condition.

    Why? Even though myCollection is safe, there is no guarantee that a change does not occur between the two method calls to myCollection: namedly Count and the indexer. Another thread can come in and remove all elements between these calls.

    This type of problem makes using a collection of this type quite frankly a nightmare. You can’t ever let the return value of one call influence a subsequent call on the collection.

    EDIT

    I expanded this discussion on a recent blog post: http://blogs.msdn.com/jaredpar/archive/2009/02/11/why-are-thread-safe-collections-so-hard.aspx

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

Sidebar

Related Questions

Time and again I find myself creating a database utility class which has multiple
Every now and again I find myself doing something moderately dumb that results in
I find myself again and again faced with a similar problem: there's some piece
From time to time I get a System.Threading.ThreadStateException when attempting to restart a thread.
I often find myself in a situation where I am facing multiple compilation/linker errors
I often find myself using lambdas as some sort of local functions to make
I find myself in a quandry that I think I know the solution to
I am working in C#. I find myself creating dialogs for editing my application
I've done this a long time ago, now I can't find the function. It
Quite often I find myself with bunch of R processes running in ESS buffers.

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.