As we know the code that accesses a common resource when enclosed within Monitor.Enter( ) and Monitor.Exit( ) helps in synchronizing concurrently running threads. What if one thread calls Monitor.Enter( ) twice. Will it go into the wait state since lock has already been acquired? The answer is no. This is because Enter( ) always checks which thread has acquired the resource before making the thread wait. Initially when resource is not acquired, count in the syncblock is set to zeros. When Enter( ) is called for the first time count becomes 1. If Enter( ) is called again and it finds that the same thread has acquired the resource it just increments the count without making the thread wait. This behavior seems logical otherwise the thread would have gone into indefinite wait state expecting from itself to release the resource. The Exit( ) method then decrements the count. When the Exit( ) method finds that the count has reached zero, it releases the lock and makes the waiting thread as the ready thread.
- On Device debugging on Sony Ericsson phones
- The Shot Heard Around the World: Google’s Endorsement of “Get Google Ads Free!”
- interview: what interests you in this role?
- What Exactly is HP0-j27 Exam?
- Is Your Software Bug-Free?
- Hire Php Programmer
- Writing Articles – What You Need To Know!
- Im interviewing for a 911 Telecommunications operator next week?
- QTPeLearn.com-QTP Testing QTP Tutorial QTP Training VB Scripts Frameworks
- vandofbyt on On Device debugging on Sony Ericsson phones
- gunnarMyTube on On Device debugging on Sony Ericsson phones
- Chris on interview: what interests you in this role?
- aunt_tashie on Im interviewing for a 911 Telecommunications operator next week?
- C on Im interviewing for a 911 Telecommunications operator next week?
- Mr. Goodhi on Im interviewing for a 911 Telecommunications operator next week?
- Jeffrey F on Is there any AS/400 website for interview preparation?
- ddawg123 on Im interviewing for a 911 Telecommunications operator next week?
- John R on Is there any AS/400 website for interview preparation?
about
advice
answer
Answers
Anyone
asked
Auctions
Best
Biology
career
CCNA
Certification
COMPUTER
Cycle
debugging
Development
find
from
good
help
Inheritance
Interview
JAVA
know
latest
life
need
Oracle
Please
Programming
question
Questions
school
should
Software
Some
someone
Tell
there
these
think
this
want
Winform
Would