From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=0.7 required=5.0 tests=BAYES_00,INVALID_DATE, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f891f,9292211c2d4756a8 X-Google-Attributes: gidf891f,public X-Google-Thread: 109fba,46882e3fad98420e X-Google-Attributes: gid109fba,public X-Google-Thread: 1014db,9292211c2d4756a8 X-Google-Attributes: gid1014db,public X-Google-Thread: 103376,48b89668821c1c9f X-Google-Attributes: gid103376,public X-Google-Thread: 1108a1,9292211c2d4756a8 X-Google-Attributes: gid1108a1,public X-Google-Thread: f78e5,9292211c2d4756a8 X-Google-Attributes: gidf78e5,public X-Google-ArrivalTime: 1995-01-20 05:06:51 PST Path: pad-thai.cam.ov.com!noc.near.net!yale.edu!yale!zip.eecs.umich.edu!newshost.marcam.com!news.mathworks.com!udel!gatech!swiss.ans.net!newsgate.watson.ibm.com!watnews.watson.ibm.com!ncohen From: ncohen@watson.ibm.com (Norman H. Cohen) Newsgroups: comp.lang.c++,comp.lang.c,comp.object,comp.lang.misc,comp.std.c++,comp.lang.ada Subject: Re: Parallel & RT GC (was Re: Real-Time GC (was Re: Widespread C++...?) Date: 19 Jan 1995 19:59:51 GMT Organization: IBM T.J. Watson Research Center Distribution: world Message-ID: <3fmgbn$rns@watnews1.watson.ibm.com> References: <787227087snz@wslint.demon.co.uk> <3ckb8g$841@gateway.wiltel.com> <1994Dec21.151952.8902@merlin.h> <19941230.201628.350635.NETNEWS@UICVM.UIC.EDU> <3e9f60$8du@jive.cs.utexas.edu> <3epfsi$64d@gamma.ois.com> <3eua1r$4ea@gnat.cs.nyu.edu> <3f5va$r07@gamma.ois.com> Reply-To: ncohen@watson.ibm.com NNTP-Posting-Host: rios8.watson.ibm.com Xref: pad-thai.cam.ov.com comp.lang.c++:70053 comp.lang.c:58342 comp.object:15725 comp.lang.misc:6836 comp.std.c++:9138 comp.lang.ada:14484 Date: 1995-01-19T19:59:51+00:00 List-Id: In article , eachus@spectre.mitre.org (Robert I. Eachus) writes: |> There is another major reason for putting the custom hardware in |> the memory system. There is a fairly large class of problems which |> require time proportional to n^k lg2 n on any von Neuman architecture, |> but can be solved in time n^(k-1) lg2 on hardware which supports |> clearing large sections of memory to zero in constant time. (Note |> that if k is one, you can get orders of magnitude improvement.) This doesn't make sense, because there is a well known programming trick (used more in analysis-of-algorithms than in real programs because of the large constant factor) for marking a large section of memory as uninitialized in constant time. (The effect of initializing a large section of memory to zero is achieved by checking on each read whether the location read from has been initialized, and using the value zero if it has not been.) The trick works as follows: View the section of memory as an array of N initializable units numbered 0 to N-1. Allocate two arrays of integers, Stack and Stack_Index, indexed from 0 to N-1. Initially, both arrays contain garbage. There is a stack pointer, Top, pointing to the highest-indexed element of Stack that does NOT contain garbage (so that initially it equals -1). When initializable unit I is initialized, Top is incremented, the new value of Top is placed in Stack_Index(I), and I is placed in Stack(Top). Then the index of every initialized unit is found exactly once in Stack(0 .. Top), and if unit I has been initialized, Stack_Index(I) contains the index within Stack(0 .. Top) containing I. The test for whether initializable unit I is initialized is: if Stack_Index(I) in 0 .. Top then if Stack(Stack_Index(I)) = I then return True; -- Stack_Index(I) contains a valid index into the stack, and the -- corresponding index in the stack indicates that unit I has -- been initialized. else return False; -- The garbage in Stack_Index(I) happened to point into the -- initialized part of Stack, but the value in Stack reveals -- that unit I was not the initializable unit for which this -- component of Stack was initialized. end if; else return False; -- Garbage in Stack_Index(I) is not even a valid stack index. end if; or, more succinctly, return Stack_Index(I) in 0 .. Top and then Stack(Stack_Index(I))=I; -- Norman H. Cohen ncohen@watson.ibm.com