Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > Other .NET > General .NET
|
General .NET For general discussion of MICROSOFT .NET topics that don't fall within any of the other .NET forum subcategories or .NET language forums.  If your question is specific to a language (C# or Visual Basic) or type of application (Windows Forms or ASP.Net) try an applicable forum category. ** PLEASE BE SPECIFIC WITH YOUR QUESTION ** When posting here, provide details regarding the Microsoft .NET language you are using and/or what type of application (Windows/Web Forms, etc) you are working in, if applicable to the question. This will help others answer the question without having to ask.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the General .NET section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 8th, 2005, 10:29 AM
Authorized User
 
Join Date: Jun 2003
Posts: 26
Thanks: 0
Thanked 0 Times in 0 Posts
Default Understanding System.Threading.ReaderWriterLock

I basically don't understand what resource is locked when AcquireReaderLock or AcquireWriterLock is called. You don't get to specify it yourself. MSDN help is no good here.
 
Old September 8th, 2005, 02:38 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 839
Thanks: 0
Thanked 1 Time in 1 Post
Default

As I understand it, there is no specific resource associated with a ReaderWriterLock. The lock is just, er, a lock. You are responsible for acquiring and releasing or otherwise managing the lock which your threads, by convention, serialize their access to your resource through.

A ReaderWriterLock may be more efficient than other locks (e.g. mutex), if you have threads reading and some (fewer) threads writing the resource. Since the lock has distinct semantics for locking reads or writes separately, with careful design you may gain a measure of throughput over another form of lock which would single thread the access to the resource without regard to whether the access is read or write.

Jeff Mason
Custom Apps, Inc.
www.custom-apps.com





Similar Threads
Thread Thread Starter Forum Replies Last Post
threading swifty_programmer ASP.NET 2.0 Basics 12 May 19th, 2007 06:10 AM
threading bschleusner C# 2005 2 April 12th, 2007 08:40 AM
System.Threading timer problem for beginner (Windo erikmail C# 2005 1 June 8th, 2006 08:03 AM
ReaderWriterLock AgentSmith General .NET 1 October 24th, 2005 04:14 PM
Threading kramis8 C# 1 April 27th, 2005 04:21 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.