Article View: borland.public.cppbuilder.nativeapi
Article #10939Re: Poor thread performance on multi-CPU machines
From: Dave Arnette
Date: Sat, 06 Mar 2004 04:11
Date: Sat, 06 Mar 2004 04:11
63 lines
3931 bytes
3931 bytes
"Arnie Mauer" <xxx@nowhere.net> wrote in message news:<40227029$1@newsgroups.borland.com>... > Thanks for your thoughts Bill > > "BillT" <billtouch_no_spam@att.net> wrote in message > news:4021a124$1@newsgroups.borland.com... > > Memory allocation is a very likely suspect. If that doesn't prove out, > there > > are a number of performance profilers to help pinpoint the exact nature of > the > > delays. > > I got an evaluation of SmartHEAP SMP but we haven't tried it yet. Code > freeze for our spring release is tomorrow, 2/6, and things have been pretty > hectic. We allocate almost all of our memory into pools up front so there's > very little done after that. However, I can't tell what's going on under > the covers with WinSock and ADOExpress/ADO/OLEDB. > > We have a profiler, AQTime. It helps to point out inefficiencies in > functions but doesn't help with thread contention. > > > Another place to look is any synchronization between threads. Where on a > > single processor, there may be no contention for any resources because > > everything is single threaded, in a multiprocessor environment, one thread > may > > end up having to wait on another thread to release a common resource thus > > less throughput. Identifying these things unfortunately must be done > manually > > by someone who can live and breathe threads. > > What you say is true. For example, ADO is not thread safe and so we must > syncronize threads that use these components. Even so, I can't understand > why the app actually runs slower on an SMP machine than on a single > processor box. I tend to think the problem is really with the memory > allocation. > > In any case, we have enough performance for the moment and we have to get > this release out. We'll probably get back to in in late March or April > > Thanks again, > > - Arnie One way to determine if it's really thread contention in the memory allocation routines is to look at the a stack trace from some of the individual threads. By examinning the stack trace and you determine that the threads are in malloc and/or free then you DO HAVE thread contention in the allocation functions. This will definately kill your scalability. Smart heap is one answer. ESA from cherrystone software is another answer. Hoard is yet another answer. ALl will solve your problem. Before choosing though, run benchmarks on your application and watch the speed and/or memory usage and choose the right memory allocation library for your application. Hoard tends to utilize less memory than either ESA or smartheap, but is slower and not as scalable. ESA tends to be much faster than smartheap, and in many cases, but not all, utilizes less memory than smartheap. But, your mileage may vary. Thats why you need to benchmark. -- Dave davearnette@comcast.net
Technical Details
Message-ID:
<fcf02b00.0403052011.35ffbf7c@posting.google.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!postnews1.google.com!not-for-mailReferences:
<3fff05ce$1@newsgroups.borland.com> <4002f804@newsgroups.borland.com> <400300f4@newsgroups.borland.com> <40054215@newsgroups.borland.com> <4021a124$1@newsgroups.borland.com> <40227029$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10cc67,6aabc16a59635b8c X-Google-Attributes: gid10cc67,public X-Google-ArrivalTime: 2004-03-05 20:11:15 PST Path: arc1-ca.pugleaf.net!archiver1.google.com!postnews1.google.com!not-for-mail From: davearnette@comcast.net (Dave Arnette) Newsgroups: borland.public.cppbuilder.nativeapi Subject: Re: Poor thread performance on multi-CPU machines Date: 5 Mar 2004 20:11:14 -0800 Organization: http://groups.google.com Lines: 63 Message-ID: <fcf02b00.0403052011.35ffbf7c@posting.google.com> References: <3fff05ce$1@newsgroups.borland.com> <4002f804@newsgroups.borland.com> <400300f4@newsgroups.borland.com> <40054215@newsgroups.borland.com> <4021a124$1@newsgroups.borland.com> <40227029$1@newsgroups.borland.com> NNTP-Posting-Host: 24.91.122.207 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1078546275 10014 127.0.0.1 (6 Mar 2004 04:11:15 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Sat, 6 Mar 2004 04:11:15 +0000 (UTC)