unable to destroy mutex: Device or resource busy
751201Feb 3 2010 — edited Feb 19 2010Hi,
I am going to test Berkeley DB for a project. In this test, we try to insert a big quantity of data and then to read them with several threads (5 for example). When the database becomes big, we have a mutex error:
'unable to destroy mutex: Device or resource busy'.
As I understood how the mutex works, we should normally have these operations:
- Mutex_lock
- Use function
- Mutex_unlock
- Mutex_destroy
My problem is that the Mutex_destroy comes before the Mutex_unlock.
That is the reason why I have the failure 'unable to destroy mutex:
Device or resource busy'. The resource (= mutex) is busy because it is
still locked.
This error message comes from mutex/mut_pthread.c
However we do not have this failure all the time but only when the
database is big. Moreover, the failure depends on computer we use. With
a computer we will have the problem very soon, with another one later.
I looked for information on the Internet but I did not find anything about mutex failure for Berkeley DB which seems to be strange because I think it is a normal use of Berkeley DB.
I would like to know if someone has an idea about this problem and how I can solve it.
Thanks a lot,
Nicolas