Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask

Re^2: Mmap question

by leriksen (Curate)
on Jan 31, 2005 at 00:46 UTC ( #426470=note: print w/replies, xml ) Need Help??

in reply to Re: Mmap question
in thread Mmap question

Your quite right about being passed on fork (but it is not copied across exec's if working at the C level).

And zentara I think your right about the octal to decimal conversion.

As for using mmap(2) for IPC, Stevens demonstrates a technique for mmap across related processes (you cant use mmap across unrelated processes, because the address is for that process family. If an unrelated process tries to use it, you'll get a SIGSEGV or SIGBUS core dump). He creates a mmap'd area from /dev/zero, then has co-operating parent and child increment a long integer in turn.

Stevens last word on mmap and shared memory is "If shared memory is required between unrelated processes, the shmXXX functions must be used" is better to be approximately right than precisely wrong. - Warren Buffet

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://426470]
[Corion]: ;)
[Corion]: Hi tye btw ;)
[Corion]: I found plenty of not chatty enough logs with Perl too ... I'm slowly coming to appreciate Log::Log4perl resp. our homegrown alternative
[tye]: my experience with python so far is more like finding a moderately useful error message is a shocking surprise.
Corion disappears
[tye]: I get an error string but no reason and no context. Like die "Could not read file.\n" but with a stack trace where all of the useful context is stripped.

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (11)
As of 2017-09-21 20:15 GMT
Find Nodes?
    Voting Booth?
    During the recent solar eclipse, I:

    Results (252 votes). Check out past polls.