| ||||
| Comment on GotW #95 Solution: Thread Safety and Synchronization by Kornner Studios (@KornnerStudios)
On the subject of C# and ‘const’ methods, there is the Code Contracts PureAttribute: http://msdn.microsoft.com/en-us/library/system.diagnostics.contracts.pureattribute%28v=vs.110%29.aspx It’s a required attribute for any method/type that is to be used in other Code Contract facilities, where the programmer claims “no visible state changes are performed by the executed systems”. “Claims” because such non-state-changing behavior isn’t enforced or verified by any current tools (assuming you even have a Code Contracts provider installed), I figured it’s an interesting foot note at least, since the subject was touched on Read More »Comment on GotW #96: Oversharing by xiongzou
if we assume that Herb only wants thread 1 reads and thread 2 writes. we can make the variable itself an active object that when write, it will duplicate its latest state and enqueue it into a threading safe queue, when read, dequeue from the queue and process the copy of the latest state. To have a better simulation of the synchronous read/write locks between two threads, make sure reading thread only process latest state if there are multiple states in the queue. Maybe a stack with sequence number in each duplicated states can help to speed up the performance. Read More » | ||||
| | ||||
| ||||
Thursday, February 13, 2014
FeedaMail: Comments for Sutterâs Mill
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment