Reputation
Top tag
Next privilege 200 Rep.
See reduced ads
Badges
6
Newest
 Editor
Impact
~342 people reached

  • 0 posts edited
  • 0 helpful flags
  • 19 votes cast
Jun
16
comment Injecting locking policy into a class
@Clockwork-Muse I edited question and added usage scenario in second paragraph. In the last couple of days, I started going down this path and I already started to feel the pain (e.g. leaking reader-writer lock specific methods into the common lock policy interface). I am going to do away with this policy approach and have the locking semantics baked into couple of specialized classes themselves derived from the Main class.
Jun
15
comment Injecting locking policy into a class
Yes, the locking object itself is shared across the threads. Policy class internally has a locking object and wraps it into a token class when a thread calls EnterRead/EnterWrite methods on policy. I have updated question with implementation for simple lock token class for more clarity.
Jun
15
revised Injecting locking policy into a class
Added simple lock token impl
Jun
15
awarded  Editor
Jun
15
revised Injecting locking policy into a class
Added simple lock token impl
Jun
14
asked Injecting locking policy into a class
Mar
5
revised Hierarchical ViewModels and tracking IsDirty/PropertyChanged events
edited tags
Mar
3
awarded  Student
Mar
3
asked Hierarchical ViewModels and tracking IsDirty/PropertyChanged events
Sep
4
awarded  Critic
Aug
26
awarded  Teacher
Aug
26
answered UI Applications and operations in background threads
Aug
12
awarded  Informed
Nov
23
awarded  Supporter