Subject: see exclusive locks per process? and O_EXLOCK between parent and
To: None <netbsd-help@netbsd.org>
From: Jeremy C. Reed <reed@reedmedia.net>
List: netbsd-help
Date: 09/25/2007 17:23:59
Any tool to list exclusive locks for a specific process?

I have a parent process that dbopen opens a database with: 
O_EXLOCK|O_RDWR.

It has a child process that also does same (two different places).

They are only open for a moment before the db->close(db);

They should block.

It seems to me that they aren't locking within this program.

I added a lock file to test. It creates a lock file immediately after 
every dbopen. And closes and removes the lock file after every 
db->close(db). But I am getting "File exists" for creating my lock files. 
(Not very often.) It appears that my dbopen is not locking or not 
blocking.

My database is getting corrupted probably due to removals or changes or 
additions at same time by different processes due to not honoring the 
exclusive lock.

I am researching this more.



  Jeremy C. Reed