Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re^4: Mmap question (fud)

by tye (Sage)
on Feb 03, 2005 at 20:21 UTC ( [id://427803]=note: print w/replies, xml ) Need Help??


in reply to Re^3: Mmap question
in thread Mmap question

mmap is great for IPC. I even worked on a flavor of Unix that had a special shared-memory semaphore (that worked on any shared memory, not just mmap'd shared memory) that required no kernel involvement unless you wanted to wait for a lock to be released.

That is, w/o involving the kernel, you can use mmap'd memory to get a lock w/o race conditions and, for the very small percentage of cases (if you've designed your system well) when there is lock contention, you allocate a kernel resource that you can sleep on and mark the mmap lock area so the lock holder will wake you up when they release the lock. I believe this shared-memory locking technique required just 4 d-words of shared memory per lock.

You can also use byte-range file locks on even an empty file that doesn't even have to be related to the mmap'd memory.

- tye        

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://427803]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (3)
As of 2024-04-24 23:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found