PC Review


Reply
Thread Tools Rate Thread

ReaderWriterLock write order

 
 
Tom
Guest
Posts: n/a
 
      28th Nov 2007
If there are multiple threads that make calls to
ReaderWriterLock.AcquireWriterLock(x), clearly all but one will be
blocked at any time.

Is the order at which the threads acquire lock (as the previous one
releases) the same order that the threads called AcquireWriterLock in
the first place (e.g. the second thread to call AcquireWriterLock will
be the second to acquire the lock, and so on, like a FIFO?)

Secondly, why isn' this in the documentation? (or did I miss it?)

Many thanks for any assistance

Tom
 
Reply With Quote
 
 
 
 
Peter Duniho
Guest
Posts: n/a
 
      28th Nov 2007
On 2007-11-27 22:26:39 -0800, Tom <(E-Mail Removed)> said:

> [...]
> Is the order at which the threads acquire lock (as the previous one
> releases) the same order that the threads called AcquireWriterLock in
> the first place (e.g. the second thread to call AcquireWriterLock will
> be the second to acquire the lock, and so on, like a FIFO?)
>
> Secondly, why isn' this in the documentation? (or did I miss it?)


I don't see anything that I'd call unambiguously explicit. But the
discussion in the main class page
(http://msdn2.microsoft.com/en-us/lib...riterlock.aspx)
talks about reader and writer queues, which suggests to me that it's a
FIFO operation.

I should probably install Reflector some day. I hear it's useful for
looking at this sort of implementation detail. I don't have first-hand
knowledge of it, but it seems likely you could use Reflector to get a
more reliable answer.

Pete

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
ReaderWriterLock Itay Microsoft C# .NET 6 9th Nov 2004 02:01 AM
ReaderWriterLock for Less Critical Session =?Utf-8?B?UWluZ2RvbmcgWi4=?= Microsoft C# .NET 0 6th May 2004 10:21 PM
ReaderWriterLock appears to contain a deadlock J.Marsch Microsoft C# .NET 3 13th Jan 2004 08:53 PM
ReaderWriterLock - static declaration necessary? Tryion Microsoft C# .NET 2 14th Nov 2003 05:37 PM
ReaderWriterLock and Collections pokémon Microsoft C# .NET 2 23rd Aug 2003 04:17 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:00 PM.