Opened 5 years ago
Closed 5 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)
Changed 5 years ago by
Attachment: | rwlock_deadlock_tight_loop.diff added |
---|
comment:1 Changed 5 years ago by
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()