From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f7344,9e63f1dd7ceb269d X-Google-Attributes: gidf7344,public X-Google-Thread: 1164f8,9e63f1dd7ceb269d X-Google-Attributes: gid1164f8,public X-Google-ArrivalTime: 1989-11-07 21:45:38 PST Path: gmdzi!unido!mcsun!uunet!snorkelwacker!apple!brutus.cs.uiuc.edu!wuarchive!decwrl!shlump.nac.dec.com!hiatus.dec.com!star.dec.com From: dipirro@star.dec.com (If it doesn't smell like chili, it probably isn't) Newsgroups: comp.sys.dec,comp.os.vms Subject: Re: Map Process address space - help! Message-ID: <1639@hiatus.dec.com> Date: 7 Nov 89 18:08:09 GMT Sender: news@hiatus.dec.com Followup-To: comp.sys.dec Organization: Digital Equipment Corporation Xref: gmdzi comp.sys.dec:1553 comp.os.vms:17871 Posted: Tue Nov 7 19:08:09 1989 In article <3334@vax1.tcd.ie>, mbrennan@vax1.tcd.ie writes... >I am implementing a garbage collector in C on a VAX 6230, and need a >little help. > >The garbage collection process is running in parallel with the user process. >The algorithm requires that the collector process be able to access(read) >the data segment(s) of the running user process. The reason for this is >that the collector needs to examine the current value of variables in >the user process each time it 'sweeps'. A parent/child relationship exists >between the collector process, and user process. > >ONE: >Any ideas on how I can share(map/access) the relevant pages of the user >process, with the garbage collector? > >TWO: >I have tried using SYS$CRMPSC (create and map section) to do this but >without success. However if you have used this call before then perhaps >you can help. > >Thanking you in advance > >Micheal Brennan >Department Computer Science >Trinity College >Dublin 2 >Ireland > >Voice : +353-1-772941 x1797 >Fax: +353-1-772204 >EMail: mbrennan@cs.tcd.ie If the processes are "cooperating," you can use a variety of interprocess communication techniques to transfer information. $CRMPSC is one that also allows the sharing of virtual address space. You specify a virtual address range and a section file in the parent. The child can map the section file into its own virtual address space (anywhere). You need to worry about synchronizing access to the data. Another way to share data between two cooperating processes, if you can set it up this way, is to use a shareable image. The shareable image would be INSTALLed as shared, used by both parent and child, and contain all the "shared" data along with any CRF data it needs. So the parent would call subroutines in the shareable image to manipulate this important data. The child could call other subroutines in the shareable image to acquire snapshots of the current contents. If the processes aren't cooperating, then in order to look in another process' address space, you have to be running in the process context of that process. This is usually done via ASTs. You deliver an AST (like a special kernel mode AST) to the process and execute your code there. In a special kernel mode AST, you have exclusive access to the data and don't have to worry about synchronizing with other threads. You can take a snapshot of the pertinent address space and stash it somewhere. Naturally, all this requires privileged, inner-mode stuff. ------------ Steve DiPirro dipirro@star.dec.com --or-- ...!decwrl!star.dec.com!dipirro --or-- dipirro%star.dec@decwrl.dec.com ------------