Path: utzoo!attcan!uunet!virtech!cpcahil From: cpcahil@virtech.uucp (Conor P. Cahill) Newsgroups: comp.unix.wizards Subject: Re: Shared memory mapping question. Message-ID: <1990Mar23.141515.8679@virtech.uucp> Date: 23 Mar 90 14:15:15 GMT References: <9464@discus.technion.ac.il> Reply-To: cpcahil@virtech.UUCP (Conor P. Cahill) Organization: Virtual Technologies Inc., Sterling VA Lines: 45 In article <9464@discus.technion.ac.il> devil%techunix.bitnet@jade.berkeley.edu (Gil Tene) writes: >My problem is : How do i "allocate" a specific area in process virtual space, >in order to map the shared memory into it. How can i specify this virtual >process address as a constant, and where do i take it from (top of user >vir. address space, etc.). Allocating using sbrk() or malloc() variaties, >doesn't give me any way to control the exact address of the allocated block... Pulling an old response out of the saved bucket: From cpcahil Wed Nov 1 09:37:04 1989 Path: virtech!cpcahil From: cpcahil@virtech.uucp (Conor P. Cahill) Newsgroups: comp.unix.questions Subject: Re: Shared memory and pointers Message-ID: <1989Nov1.143704.9258@virtech.uucp> Date: 1 Nov 89 14:37:04 GMT References: <525@wizard.UUCP> Distribution: usa Organization: Virtual Technologies Inc. Lines: 24 In article <525@wizard.UUCP>, john@wizard.UUCP (John Danner) writes: > group, neither of which are very clean. First, make sure that every client > maps each block of shared memory to the same location. Second, replace > pointers with something like objectID's and keep a table on the server which > has block #'s and offsets for each objectID. I have seen 2 solutions to these problems. 1. have the first program that creates the shared memory segment attach it at whatever address it determins is appropriate and then writes said address into the first 4 bytes of the shared memory segment itself. All follow on program will attach the segment at the default address, read the address that it should be attached at, detach it, and finally re-attach it at the appropriate address. 2. keep track of data using relative pointers (offset from the begining of the shared memory segment) this is a real bear. -- Conor P. Cahill (703)430-9247 Virtual Technologies, Inc., uunet!virtech!cpcahil 46030 Manekin Plaza, Suite 160 Sterling, VA 22170