• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 707
  • Last Modified:

TMultiReadExclusiveWriteSynchronizer.EndWrite throw EAccessViolation

Hi,

A TMultiReadExclusiveWriteSynchronizer that was initialized (in the initialization section of the unit) raised a EAccessViolation on attempt to EndWrite().
This happen suddently after many calls to the function containing the call to EndWrite()

How can that be?

(Delphi 6 Professinal)

Offir.
0
mathought
Asked:
mathought
  • 3
  • 2
1 Solution
 
AvonWyssCommented:
Maybe the memory area whgere the object is stored in got overwritten, or its pointer was somehow corrupted? This is more often the case than you may think.
0
 
AvonWyssCommented:
Deadlocks have nothing top do with AVs. Therefore, this bug (which actually is a conclusion of the way a TMultiReadExclusiveWriteSynchronizer works) has nothing to do with the problem mentionned here.

A deadlock happens when two (or more) threads are in a waiting state, each one waiting for the other one, therefore never existing the wait state.
0
 
mathoughtAuthor Commented:
I had both daed-locks and this AV.
When I moved to TCriticalSection, the problem disappeared.
0
 
AvonWyssCommented:
A critical section is both smaller and cannot lead to deadlocks as long as only one CS is in use. However, I still would not expect any AV to happen.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now