Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sun-barr!olivea!decwrl!sgi!shinobu!odin!flobb4!micah From: micah@flobb4.csd.sgi.com (Micah Altman) Newsgroups: comp.sys.sgi Subject: Re: Use of malloc with multiprocessing code Message-ID: <1991Feb8.201903.27756@odin.corp.sgi.com> Date: 8 Feb 91 20:19:03 GMT References: <1991Feb7.192217.11811@portia.Stanford.EDU> Sender: news@odin.corp.sgi.com (Net News) Organization: Silicon Graphics, Inc. Mountain View, CA Lines: 24 In <1991Feb7.192217.11811@portia.Stanford.EDU> dhinds@portia.Stanford.EDU (David Hinds) writes: >I want to use the fast malloc, but I don't need the semaphoring stuff >in the arena calls. Should I link with -lmalloc and -lmpc? When I do >this, I get linker warnings about duplicate definitions of the malloc >functions. If you link with both you will only get one. Instead, link with -lmpc, and use the usconfig(3P) call to turn off semaphoring in your malloc calls. (use the CONF_STHREADMALLOCOFF ). Do this call before you create your parallel threads. If you do this, you must make sure that you aren't making calls to malloc in parallel. B.T.W. - An additional difference between -lmalloc and -lmpc malloc calls is that mallocs made with when linked with -lmpc are quad-word aligned rather than double word alligned. This can be important for cache line alignment and graphics DMA transfers. Hope this helps. -- "Entia non sunt multiplicanda sine necessitate." - William of Ockham Micah Altman micah@csd.sgi.com "Computational Juggler" Phone (415) 335-1866