Re: Multiple links to shared memory segments

From: Mike Stroyan (stroyan_at_hpstryn.fc.hp.com)
Date: 02/05/04

  • Next message: Chauncy Desmond: "Non root SAM role delegation?"
    Date: Thu, 05 Feb 2004 20:49:21 GMT
    
    

    James Galbraith <galbja@inel.gov> wrote:
    |I've been migrating some software developed under Linux, Solaris, and
    |SGI to one of our HP platforms and have run into a roadblock. I've
    |got a few objects that each need to attach to the same shared memory
    |segment. I'm using the POSIX shm_open() and mmap() functions. The
    |first attach completes OK, with all following attaches failing with
    |the dreaded ENOMEM error. This is documented in the man pages,
    |indicating that HPUX is unable to support multiple links to a single
    |shared memory segment to to the memory architecture. It continues to
    |indicate that if the mmap call is modified to use the MAP_VARIABLE
    |option and let the OS determine the location it is mapped, all will be
    |OK. Well, it isn't. I've tried the method(s) indicated in the man
    |page and continue to have problems.

    |Has anyone out there had any success utilizing multiple links to a
    |shared memory segment using the POSIX functions?? If so, I would
    |greatly appreciate hearing about your solution so I can get my porting
    |on track.

      Showing more details would make it easier to see what has gone
    wrong. The tusc system call tracer can be very helpful for examining
    what got mapped where before an error occured. It is available from
    http://hpux.cs.utah.edu/hppd/hpux/Sysadmin/tusc-7.5/

      Try to map the full range of a shared file or shared memory object
    every time you mmap it. That will make sure it is placed in an address
    range that has room for mapping ranges that you might be looking for
    later. Also avoid munmap before all uses are complete.

      The HP-UX 11.23 release for Itanium based systems adds a
    "ld +as mpas" option that allows shared memory to have more than one
    mapping. You would need a new Itanium based system like a zx2000 or
    zx6000 to use that release. The new feature is described in
    http://h21007.www2.hp.com/dspp/files/unprotected/Itanium/aas_white_paper.pdf

    -- 
    Mike Stroyan, mike.stroyan@hp.com
    

  • Next message: Chauncy Desmond: "Non root SAM role delegation?"

    Relevant Pages

    • Re: Is shmdt() necessary?
      ... When using shared memory, one process usually attaches to the shared ... memory by calling shmat, and will detach from it before it exits, by ... attach number if one process ends without calling shmdt. ... Some people find it more elegant to explicitly detach everything they ...
      (comp.os.linux.development.system)
    • Multiple links to shared memory segments
      ... got a few objects that each need to attach to the same shared memory ... shared memory segment to to the memory architecture. ... I'd like to stay away from creating global pointers for the obvious ...
      (comp.sys.hp.hpux)
    • Re: Non contiguous Virtual Memory
      ... > There is no need to attach or detach from the shared memory. ... > You will just slide the view over the same section. ... Windows shared memory concept so excuse me if I am asking any silly question ...
      (microsoft.public.win32.programmer.kernel)
    • Re: sharing memory with non-children
      ... are two main types of shared memory available on most systems. ... Can you use mmap in this way? ... client process wants to communicate with the daemon using some form of shared memory. ... same shared memory segment. ...
      (comp.unix.programmer)
    • Does Windows 2003 change the security strategy of shared memory?
      ... So we could attach the shared memory using the shmid(the same as UNIX). ... it's OK to attach the shared memory the service created. ... But under Windows 2003, it's not possiable to attach the shared memory even using "administrator". ...
      (microsoft.public.windows.server.general)

  • Quantcast