From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: * X-Spam-Status: No, score=1.5 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM,TO_NO_BRKTS_PCNT autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,ee1e7bdc743a3545,start X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!postnews.google.com!q2g2000pre.googlegroups.com!not-for-mail From: Anatoly Chernyshev Newsgroups: comp.lang.ada Subject: Multicore problem Date: Tue, 9 Mar 2010 09:48:37 -0800 (PST) Organization: http://groups.google.com Message-ID: <80b7542b-38d7-4da2-aa50-1c734b3c516c@q2g2000pre.googlegroups.com> NNTP-Posting-Host: 82.178.69.92 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: posting.google.com 1268156917 17085 127.0.0.1 (9 Mar 2010 17:48:37 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Tue, 9 Mar 2010 17:48:37 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: q2g2000pre.googlegroups.com; posting-host=82.178.69.92; posting-account=g6PEmwoAAADhFsmVm6Epjviaw4MLU0b5 User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.8) Gecko/20100202 Firefox/3.5.8 (.NET CLR 3.5.30729),gzip(gfe),gzip(gfe) Xref: g2news1.google.com comp.lang.ada:9491 Date: 2010-03-09T09:48:37-08:00 List-Id: Hello, everyone, Here is the following problem: large 3D array, which can be processed in parallel. Naturally, I was trying to make use of 2 cores on my processor by splitting the whole calculation into several parallel tasks. Strangely, I could actually see that the program utilizes both cores now (even not by 100% as I wished), but the computation time increases more than 2 times when there are 2 tasks are running on 2 cores. During calculation any 2 or more tasks can occasionally modify the same array member, for which a protected type is introduced. Here are results of benchmarking for my 2 core system (Intel P4 Dual Core, Win XP SP3): 1 task (50% total proc. load): 680 sec. 2 tasks (70-93% load): 1520 sec. 4 tasks (70-93% load): 1195 sec. Any ideas on why it might happen and how to get around it? Thank you.