From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6037 invoked by alias); 23 May 2005 17:43:27 -0000 Mailing-List: contact ecos-discuss-help@ecos.sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: ecos-discuss-owner@ecos.sourceware.org Received: (qmail 6023 invoked by uid 22791); 23 May 2005 17:43:24 -0000 Received: from norbert.ecoscentric.com (HELO smtp.ecoscentric.com) (194.153.168.165) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Mon, 23 May 2005 17:43:24 +0000 Received: by smtp.ecoscentric.com (Postfix, from userid 99) id 5F4E965C102; Mon, 23 May 2005 18:43:22 +0100 (BST) Received: from [127.0.0.1] (localhost [127.0.0.1]) by smtp.ecoscentric.com (Postfix) with ESMTP id 1C60165C064; Mon, 23 May 2005 18:43:21 +0100 (BST) Message-ID: <42921638.1090405@jifvik.org> Date: Tue, 24 May 2005 08:48:00 -0000 From: Jonathan Larmour User-Agent: Mozilla Thunderbird 1.0.2-1.3.3 (X11/20050513) MIME-Version: 1.0 To: =?ISO-8859-1?Q?=D8yvind_Harboe?= Cc: Jerome Souquieres , ecos-discuss@sources.redhat.com References: <1116664216.28556.45.camel@localhost.localdomain> <4291A7C3.5000801@kis.fr> <1116843565.19282.8.camel@localhost.localdomain> In-Reply-To: <1116843565.19282.8.camel@localhost.localdomain> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit Subject: Re: [ECOS] Lightweight C++ multithreaded exceptions X-SW-Source: 2005-05/txt/msg00306.txt.bz2 Øyvind Harboe wrote: > On Mon, 2005-05-23 at 11:52 +0200, Jerome Souquieres wrote: > >> That's interesting. However, from what I understand, this approach >>only solves the multithreaded exceptions problem. This does nothing to >>ensure that the standard C++ library (including STL) is thead safe. Am >>I right ? > > > I know there are some atomicity issues, but is that already handled in a > CPU architecture specific but os-independent fashion by default in > libstdc++? libstdc++ has atomicity primitives for some CPUs, including x86, m68k, mips, powerpc and SPARC. Notably it doesn't include ARM, probably because at least on some ARM architecture versions it isn't possible. I don't know for definite about recent ARM architecture versions. But even that little atomicity support is only used in a handful of places, and on unsupported architectures it falls back to mutexes if available. However the key issue is that STL primarily uses OS mutexes if available, and also needs "once" variables. Without those, it is not thread-safe. > Does anyone know of a definitive list of issues w.r.t. libstdc++ & > multithreading? There is support for multithreading, but you have to do it its way. It's possible to hack it of course, but to do it the right way takes more effort. Certainly I had to make other changes to eCos (and the tools) to properly pass the libstdc++ testsuite. As you may have seen, there's a lot of tests there! It's probably inappropriate for me to comment on your suggested changes to kernel rescheduling to support the fc_static munging, but personally I don't believe kernel modifications are the right way. I know, I know, sitting here with it all working, I would say that wouldn't I :-). > I guess the fact that eCosCentric is destined to contribute their > libstdc++ support saps my initiative for contributing patches in this > area. While that is ultimately true, as I indicated before, it will not be in the near future. Anyone who hopes to hang on a bit in their project for it to be released publically is likely to be disappointed. > Even more so, because I have a solution for my needs. Your patches and instructions will certainly work in some situations. Some of it was using the code I included for our own C++ support anyway but did release :-), e.g. CYGPKG_LIBC_I18N_NEWLIB_CTYPE. But there are definitely a lot of gotchas once you introduce variation, including when you change to different architectures or try to use the libstdc++ library itself. Jifl -- --["No sense being pessimistic, it wouldn't work anyway"]-- Opinions==mine -- Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss