Opened 6 years ago
Closed 6 years ago
#204 closed defect (fixed)
pthread: wrlock() causes CPU load to 99.9% and tryrdlock()/trywrlock() falls into deadlock
Reported by: | KO Myung-Hun | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | |
Component: | *none | Version: | |
Severity: | medium | Keywords: | |
Cc: |
Description
Hi/2.
Let's see the following case.
- main thread: acquire rdlock
- second thread: try to acquire wrlock
- third thread: try to acquire tryrdlock
In 2., CPU load gets to 99.9% because of a tight loop in pthread_rwlock_wrlock(). And In 3., deadlock occurs in pthread_rwlock_tryrdlock() because lock->mutex is not released in pthread_rwlock_wrlock().
This occured in the test of pthread_rwlock_rdlock.m4.
Attachments (1)
Change History (2)
by , 6 years ago
Attachment: | rwlock_deadlock_tight_loop.diff added |
---|
comment:1 by , 6 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
fixed in r2328
thx for the patch
Note:
See TracTickets
for help on using tickets.
Patch for deadock in pthread_rwlock_tryrdlock()/trywrlock() and a tight loop in thread_rwlock_rdlock()/wrlock()