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.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,988775aa21583bbb X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!atl-c08.usenetserver.com!news.usenetserver.com!pc03.usenetserver.com!ALLTEL.NET-a2kHrUvQQWlmc!not-for-mail Date: Wed, 21 Dec 2005 08:25:39 -0600 From: "Marc A. Criley" User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206) X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: GNAT and multi-processor References: <1135156099.726370.254790@g44g2000cwa.googlegroups.com> In-Reply-To: <1135156099.726370.254790@g44g2000cwa.googlegroups.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Message-ID: <6cbb1$43a9660e$49956b9$12262@ALLTEL.NET> X-Complaints-To: abuse@usenetserver.com Organization: UseNetServer.com X-Trace: 6cbb143a9660ea13cf31c12262 Xref: g2news1.google.com comp.lang.ada:6956 Date: 2005-12-21T08:25:39-06:00 List-Id: huynh@cena.fr wrote: > I have big problems with Ada/GNAT programs running on multi-processor > or > hyperthreaded Linux machines : > segmentation fault resulting in STORAGE_ERROR or PROGRAM_ERROR. > > When they run on Linux mono-processor or Solaris machines, there is no > problem ! > > - Is there any way to make my programs use only ONE processor ? > - Or any way to change the threading policy ? (I cannot use FSU-threads > because of I/O that would block the entire process) Genuinely concurrent programming is hard. It's only been relatively recently that multi-processor and multi-core systems have become widespread, so up till now most multi-tasking programs haven't been exposed to executing separate tasks truly simultaneously. Simulated multi-tasking wherein the reality is that actually only one task is ever executing at a time can cover up implementation defects relating to race conditions, deadlock, and simultaneously updating/accessing an unprotected resource. While locking the program to one CPU would likely resolve your issue, it's at best a short-term fix. In all likelihood, there's an error in your implementation where an implicit assumption is being made that only one task is ever executing at a time, and that's what needs to be addressed. Judging by the failures you're getting, my first guess would be that a simultaneous access/update is occurring. For a general overview of multi-core and multi-processor issues, try (I believe) the 9/05 issue of ACM Queue; here's a representative article: http://www.acmqueue.com/modules.php?name=Content&pa=showpage&pid=333. -- Marc A. Criley -- McKae Technologies -- DTraq - XPath In Ada - XML EZ Out