Path: utzoo!attcan!uunet!munnari.oz.au!goanna!ajk From: ajk@goanna.cs.rmit.oz.au (Alan Kent) Newsgroups: comp.sys.encore Subject: share_malloc under UMAX V Message-ID: <3389@goanna.cs.rmit.oz.au> Date: 9 Jul 90 05:35:39 GMT Organization: Comp Sci, RMIT, Melbourne, Australia Lines: 35 I give up. I am trying to use the share_malloc_init(), share_malloc(), spin_create() and semaphore_create() functions to set everything up for a parallel index rebuild program (for a research database system). My problem is that I calculate the total amount of memory that I will need and pass this to share_malloc_init(), but share_malloc() fails near the end of all the allocation code. I assume it is running out of shared memory to allocate. I am positive there are no array overflows or that sort of thing - I am simply doing a series of share_malloc() calls. For every share_malloc() call, I allocate an additional 16 bytes for any structures share_malloc() may need internally. I even add an extra 10k on at the end. But this still does not work reliably (sometimes it does, sometimes it doesn't). I do not like the solution of simply adding another 10k again as it might fix the problem for now, but at some time in the future it will still fail again. So, can anyone tell me how to calculate the number to pass to share_malloc_init() given that you know the number of calls to share_malloc() and the exact amount that needs to be allocated for each call? Any help would be much appreciated. Ps: the code works perfectly when the mallocs suceed. I dont really want to have to rewrite several thousand lines of code to switch over to the threads package (not that I know anything about the threads package). ------------------------------------------------------------------------------- Dr. Alan Kent, ACSNET: ajk@goanna.cs.rmit.OZ Key Center for Knowl. Based Sys., INTERNET: ajk@goanna.cs.rmit.OZ.AU RMIT Dept. of Comp. Sci., JANET: ajk%au.oz.goanna@uk.ac.ukc GPO BOX 2476 V, BITNET: ajk%goanna.cs.rmit.OZ.AU@relay.cs.net Melbourne, 3001, AUSTRALIA UUCP: ..!uunet!goanna.cs.rmit.OZ.AU!ajk Phone: +61 3 660 2992 Fax: +61 3 662 1617