Skip to contentSkip to conversation

Cheap lock for user mode processes release when process exits

DISCUSSION [email protected] 2 participants 2 messages Apr 13, 2007

lore
Share & tools
lore
#0 lore raw

Hi all,

Maybe someone here knows better.

I have several user-mode processes using shared mmap. There can be several reader processes and only one writer. Readers access the shared region frequently, writer seldom.

Naturally, multi-reader/single-writer locks works best. I tried this with futex on 2.6.9-42.EL. However, if one of the processes is killed/exits, the lock doesn't get released.

I can trap the signal to release the lock, but not all signals like kill.

Anyway I can achieve this without a potential deadlock?

Thanks,
Michael

#1 lore raw
Quoted 4 lines · On Fri, 13 Apr 2007 01:54:28 +0000 (GMT) <[email protected]> wrote:

Hi all,

Maybe someone here knows better.

Quoted 8 lines

I have several user-mode processes using shared mmap. There can be several reader processes and only one writer. Readers access the shared region frequently, writer seldom.

Naturally, multi-reader/single-writer locks works best. I tried this with futex on 2.6.9-42.EL. However, if one of the processes is killed/exits, the lock doesn't get released.

I can trap the signal to release the lock, but not all signals like kill.

Anyway I can achieve this without a potential deadlock?

Robust futexes: http://lwn.net/Articles/172149/

But I don't know whether RH backported them into RHEL4.