Quantcast
Channel: Thread Lock Question
Browsing all 6 articles
Browse latest View live

Thread Lock Question

The volatile keyword ensures that read/writes to a variable are done without being optimized to a register or temporary memory.  While it's good practice to mark members as volatile that may be...

View Article



Thread Lock Question

Also I would add that _foo should be tagged volitile hence eliminating the need for lock as well...

View Article

Thread Lock Question

 Peter Ritchie wrote:LOCK is not a value type. Or, do you mean the synchronized access to _Foo;Value type in that _Foo is a value type which is being returned in the user's code. Peter Ritchie...

View Article

Thread Lock Question

 OmegaMan wrote:Off the bat, you are locking a value type which gets copied on return of the getter. The setting and extracting are safe for _foo...but if your intention is does the lock remain if...

View Article

Thread Lock Question

Off the bat, you are locking a value type which gets copied on return of the getter. The setting and extracting are safe for _foo...but if your intention is does the lock remain if someone is using the...

View Article


Thread Lock Question

I'm just kind of curious on this.  I wasn't sure how to test it on my own as it is a threading issue and not reliable.  Consider the following example. Code Snippetprivate object LOCK = new object();...

View Article
Browsing all 6 articles
Browse latest View live




Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>
<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596344.js" async> </script>