Why aren't classes like BindingList or ObservableCollection thread-safe?

前端 未结 4 1462
难免孤独
难免孤独 2021-01-31 18:27

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 m

4条回答
  •  遇见更好的自我
    2021-01-31 18:58

    To add a little to Jared's excellent answer: thread safety does not come for free. Many (most?) collections are only used within a single thread. Why should those collections have performance or functionality penalties to cope with the multi-threaded case?

提交回复
热议问题