Re: lock used in thread and by event
- From: uupi_duu@xxxxxxxxx
- Date: Tue, 25 Sep 2007 04:37:41 -0700
Hello, I can't post the program but code was in previous posting.
But what I would like to know is that is event call executed in caller
thread's context or
in the context of that thread were the event handler code is? To
clearify: is event call
same as a method call and executed in context of the thread which has
the actual event handler?
So, is my example of two different threads using event and same lock-
variable in first thread
same thing that what happends when one thead calls lock(this) too
times sequentially (and it does
not start waitiing in second lock call).
Cheers!
On 25 syys, 14:18, Jon Skeet [C# MVP] <sk...@xxxxxxxxx> wrote:
<uupi_...@xxxxxxxxx> wrote:
<snip>
What I have noticed that lock(_myList) does not stop and start waiting
if one of the threads have aquired it.
It will do if it's a different thread.
lock(_myList) goes allways through. So, can anyone explain that is
Event call same as a call executed in thread that owns lock(_myList)
or how this goes?
Can anyone clarify this to me?
Any documentation considering this issue?
Could you post a short but complete program which demonstrates the
problem?
Seehttp://www.pobox.com/~skeet/csharp/complete.htmlfor details of
what I mean by that.
--
Jon Skeet - <sk...@xxxxxxxxx>http://www.pobox.com/~skeet Blog:http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too
.
- Follow-Ups:
- Re: lock used in thread and by event
- From: Jon Skeet [C# MVP]
- Re: lock used in thread and by event
- References:
- lock used in thread and by event
- From: uupi_duu
- Re: lock used in thread and by event
- From: Jon Skeet [C# MVP]
- lock used in thread and by event
- Prev by Date: Re: Spot the bug (three line program) and a question on how to order execution flow in a OOP
- Next by Date: Re: lock used in thread and by event
- Previous by thread: Re: lock used in thread and by event
- Next by thread: Re: lock used in thread and by event
- Index(es):
Relevant Pages
|
Loading