Re: Another locking question.
From: Richard Blewett (richard_at_dotnetconsult.co.uk)
Date: 09/12/04
- Next message: MarkD VIT_at_UK: "Re: Problem with .NET 1.1 SP1 - Events"
- Previous message: R.Wieser: "Re: How to retrieve serial number of OS or CPU for copy protection?"
- In reply to: Morten Wennevik: "Re: Another locking question."
- Messages sorted by: [ date ] [ thread ]
Date: Sun, 12 Sep 2004 09:50:14 +0100
>From testing this out a while back:
if the other threads are of equal priority they appear to aquire the lock in
teh order they requested it (I haven't see this *documented* anywhere so I
wouldn't base my system on this behavior).
If Thread 3 has a higher priority than Thread 2 it will acquire the lock
first (at least this was the behavior I observed) irrespective of the order
the two threads attempted to acquire the lock - which is how it should be
Regards
Richard Blewett - DevelopMentor
http://staff.develop.com/richard/weblog
"Morten Wennevik" <MortenWennevik@hotmail.com> wrote in message
news:opsd6dc6jaklbvpo@stone...
> Hi Cool Guy,
>
> I'm not entirely certain of this, but I think you have no way of knowing
> which of the waiting threads aquires the lock after it is released.
> Thread 2 and thread 3 have equal priority in aquiring the lock, and thread
> 3 might get the lock before thread 2.
>
> --
> Happy coding!
> Morten Wennevik [C# MVP]
- Next message: MarkD VIT_at_UK: "Re: Problem with .NET 1.1 SP1 - Events"
- Previous message: R.Wieser: "Re: How to retrieve serial number of OS or CPU for copy protection?"
- In reply to: Morten Wennevik: "Re: Another locking question."
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|