comp.lang.ada
 help / color / mirror / Atom feed
From: "Marc A. Criley" <mcNOSPAM@mckae.com>
Subject: Re: GNAT and multi-processor
Date: Wed, 21 Dec 2005 08:25:39 -0600
Date: 2005-12-21T08:25:39-06:00	[thread overview]
Message-ID: <6cbb1$43a9660e$49956b9$12262@ALLTEL.NET> (raw)
In-Reply-To: <1135156099.726370.254790@g44g2000cwa.googlegroups.com>

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



  reply	other threads:[~2005-12-21 14:25 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-12-21  9:08 GNAT and multi-processor huynh
2005-12-21 14:25 ` Marc A. Criley [this message]
2005-12-21 20:49 ` Jeffrey R. Carter
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox