*BSD News Article 20273


Return to BSD News archive

Xref: sserve comp.unix.programmer:11436 comp.unix.bsd:12517
Newsgroups: comp.unix.programmer,comp.unix.bsd
Path: sserve!newshost.anu.edu.au!munnari.oz.au!news.Hawaii.Edu!ames!agate!doc.ic.ac.uk!uknet!mcsun!sun4nl!tedux.hobby.nl!mo.hobby.nl!compi.hobby.nl!muts
From: muts@compi.hobby.nl (Peter Mutsaers)
Subject: mmap for shared memory, how to use efficiently?
Sender: muts@compi.hobby.nl (Peter Mutsaers)
Organization: My unorganized home
Date: Wed, 1 Sep 1993 21:16:24 GMT
X-Attribution: PLM
Message-ID: <MUTS.93Sep1221625@compi.hobby.nl>
Lines: 20

Hello,

I want to use mmap to get some memory at a specific memory location
(where some global variables exist). It must be shared between 2
processes.

I can use a normal file as the shared object, like /tmp/mmap_file. But
in that case, the speed is quite low because operations seem to update
the real file immediately, therefore the shared memory speed is as low
as the disk speed.

Can someone help me and tell what the normal/best way is to use mmap;
is it possible to open /dev/mem or something like that and then use
that as shared object, or is there another device that will not cause
disk IO but still be accessible between 2 or more processes?

Thanks in advance,
-- 
_______________________________________________________________
Peter Mutsaers, Bunnik (Ut), the Netherlands.