home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.parallel
- Path: sparky!uunet!gumby!destroyer!gatech!hubcap!fpst
- From: tve@crackle.CS.Berkeley.EDU (Thorsten von Eicken)
- Subject: Re: (comp.lang.functional) tree of frames
- Message-ID: <1992Dec28.160310.27135@hubcap.clemson.edu>
- Keywords: tree of frames ...
- Sender: fpst@hubcap.clemson.edu (Steve Stevenson)
- Nntp-Posting-Host: crackle.cs.berkeley.edu
- Organization: University of California, Berkeley
- References: <1992Dec23.140907.21427@hubcap.clemson.edu>
- Date: 24 Dec 1992 07:22:25 GMT
- Approved: parallel@hubcap.clemson.edu
- Lines: 44
-
- In article <1992Dec23.140907.21427@hubcap.clemson.edu> sreedhar@cs.mcgill.ca (V.C. SREEDHAR) writes:
- >I read in PRISC (Nikhil and Arvind) that they support
- >tree of frame for function invocation.
- >In a stack model it is much simpler to manage the stack of
- >frames. For supporting tree of frames one has to
- >allocate space from the heap. This could an expensive operation.
-
- Yes and no. Basically, instead of adding to or subtracting from the
- stack pointer, you ``call malloc''. This is the simple but expensive
- way. More realistically, you write your own memory allocator and inline
- the typical case. Usually you'd choose a binned allocator, i.e., a
- table of free lists per block size (good mallocs do that too). Notice
- that the frame size is normally static, so you can generate the index
- into the table at compile time. If you want, you can optimize the table
- to only have entries for frame sizes that actually occur in the
- program. The next optimization is to use ``stacklets'': small fixed
- sized stacks which allow you to use stack allocation for one child
- frame most of the time. Haven't gotten around to implement that yet,
- others might be able to comment!?
-
- >Also how does one manage the run time heap.
- >How does one compile programs to support tree of frames.
-
- I think the major cost in tree-of-frame allocation is in argument passing
- and not so much in the heap allocation itself (if well done). You can't
- pass arguments in registers easily (tree of frames implies parallel call).
- Arguments have to be stored relative to the newly allocated frame. You also
- have to pass an invisible `return pointer' so that the child knows where to
- deposit result values (and what continuation to enable).
-
- >In terms of storage space management, I find difficult to
- >understand management of tree of frames (unlike
- >in stack based model, which is simple to implement).
-
- Nothing magic. Just need to keep track of parent/child pointers explicitly
- as in any tree data structure.
-
- >Thanks a lot
-
- I'm sure others will have more to add...
-
- Thorsten von Eicken
- tve@cs.berkeley.edu
-
-