From mboxrd@z Thu Jan 1 00:00:00 1970 From: hjl@lucon.org (H.J. Lu) To: shanem@netcom.com (Shane Miller) Cc: libc-hacker@sourceware.cygnus.com (GNU C Library) Subject: Re: how is malloc/free done in SMP linux Date: Wed, 11 Aug 1999 10:56:00 -0000 Message-id: <19990811175647.A6AE957BB@ocean.lucon.org> References: <199908101513.IAA13569@netcom17.netcom.com> X-SW-Source: 1999-08/msg00031.html > > Sir; > > i am beginning development of a CAD like program. it will be > threaded and multi-processor capable (well thanks to SMP O/S > like linux). > > as to the linux's memory management, suppose a program has > 30 threads. each thread is allocating and deallocating memory. > > does linux block the other 29 threads when thread wants > to malloc/free? how about other threads/processes in the process > table? > > in a regular, single-processor system, my original C++ program > spent 50% of its time in malloc/free. i reduced this time very > significantly by implementing memory pools. the basic algorithm is fairly > easy to split up across threads. hence linux SMP for more performance. > but i am wondering if i might be walking into a "technical snare" > with respect to linux and memory management. > This has little to do with kernel. I forwarded this to the glibc mailing list. -- H.J. Lu (hjl@gnu.org)