Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!clyde.concordia.ca!mcgill-vision!bloom-beacon!snorkelwacker!apple!usc!samsung!munnari.oz.au!mimir!hugin!augean!idall From: idall@augean.OZ (Ian Dall) Newsgroups: comp.os.mach Subject: Stack space for threads Message-ID: <688@augean.OZ> Date: 14 Dec 89 10:25:46 GMT Reply-To: idall@augean.OZ (Ian Dall) Organization: Engineering Faculty, University of Adelaide, Australia Lines: 19 How is automatic variable space handled for threads? I can think of two possibilities. One is to give each thread its own copy of the stack marked copy write and the other is to allocate some chunk of memory and set the stack to the top of it. The first means that starting a new thread is like a semi fork. The stack gets copied but the data region (and of course the text region don't). This approach has the effect that threads can never modify each others automatic variables, even through pointers. It has the advantage, however, that the virtual address space is kept simple. Otherwise the virtual address space gets fragmented and this could be a pain if one can't predict how much the various regions will grow. Of course with very large virtual address spaces this is less of a problem. Would someone like to briefly summarize the Mach thread primitives? -- Ian Dall life (n). A sexually transmitted disease which afflicts some people more severely than others. idall@augean.oz