RE: The shocking truth about the C# lock statement

OK, so my example was a bit contrived.  In most cases what we do in our critical sections would be more than just adding to a List<>.  And in those cases, if an exception is thrown, we would hold the lock.   The next thought that came from that was that if you use an established pattern (lock), then why mix?   I believe that you should use the right tool for the right job.   I will have to chew on this more before I acquiesce on this point, however.   I would like to hear other opinions.

Advertisements
This entry was posted in Performance. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s