This is the mail archive of the
ecos-patches@sourceware.org
mailing list for the eCos project.
Re: POSIX threads early startup C++ exceptions
- From: "Øyvind Harboe" <oyvind dot harboe at zylin dot com>
- To: "Jonathan Larmour" <jifl at jifvik dot org>
- Cc: "Andrew Lunn" <andrew at lunn dot ch>, ecos-patches at ecos dot sourceware dot org
- Date: Fri, 11 Aug 2006 18:52:48 +0200
- Subject: Re: POSIX threads early startup C++ exceptions
- Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; b=oC4YIlhst+kpIBV11ABGwnufn9db1BbZTlq7ypMq73XYl+XiBMZx8/5jJ8bGPqbXipabFb2cXZMTTU8wTLkTP3cVD74B+2JgngCBfgYfTIVuuKWdJnum1rcNbh5wywL98FmPbhRiP7B0kAEPMadfhYZwAgw9+2ZEoS1yZIpX9iE=
- References: <c09652430608110159y616a9c94ub897d012c7d546b9@mail.gmail.com> <20060811091212.GI2053@lunn.ch> <c09652430608110214k9829af8i7f77213ef1f36e58@mail.gmail.com> <44DCA974.7050200@jifvik.org>
On 8/11/06, Jonathan Larmour <jifl@jifvik.org> wrote:
Øyvind Harboe wrote:
> On 8/11/06, Andrew Lunn <andrew@lunn.ch> wrote:
>> On Fri, Aug 11, 2006 at 10:59:57AM +0200, ?yvind Harboe wrote:
>> > This went by ignored at the time, but it is still very much relevant
>> > for early startup handling of pthreads exceptions.
>> >
>> >
>> > http://sources.redhat.com/ml/ecos-patches/2005-04/msg00007.html
>>
>> I don't know the POSIX code very well. So this needs to be reviewed by
>> Nick or Jifl.
>
> eCosPro contains support for libstdc++ and this patch is to improve
> support for libstdc++ using POSIX threads. Could be an awkward silence
> here. :-)
Don't feel victimised, I'm pretty lousy to everyone ;). I am very aware of
the potential conflict of interest, which is why I (and others) avoid some
stuff, even just in case people _perceive_ we're saying something because
of our employer, even if it's not. But I guess here it can't be avoided, so
I assure you I am thinking with my maintainer hat here, not eCosCentric.
I don't feel victimized. I have my C++ exceptions and they work just
fine. I just see your problem with having two masters. The bible has a
thing or two to say about having two masters :-)
By implication from this code, you're trying to get C++ code to operate
even before the kernel is initialised, hence the hoops with self==NULL.
It's an invitation to problems. I'm extremely hesitant about trying to
claim that C++ code will work at such an early stage of initialisation.
It's hard to argue against a fear about something that you believe might exist.
HALs, and the device driver API have been written as C entirely
intentionally and by design, not because of a dislike of C++ as the
existence of the kernel sources prove :).
I think eCos should support exceptions at such an early stage for all
the reasons I'm using exceptions in the first place. Which is why I
wrote the code in the first place.
Even CYG_INIT_IO is after CYG_INIT_KERNEL, so I'm not clear what
initialisation you are trying to support. C++ exceptions in the HAL? I'd
surely have thought not, but if not but it's HAL code, why not just build
with -fno-exceptions.
I'm decompressing an FPGA image while programming an FPGA. There are
*many* things that can go wrong and this code is *greatly* simplified
by having exceptions.
Decompressing the FPGA must happen before CYG_INIT_IO since there is a
UART in the FPGA.
These changes also add bloat to support something that almost no-one will
want to do, and are at best hardware specific.
Bloat? Isn't this so little as to nearly be a matter of subjective
opinion? Doesn't POSIX threads get used in system that have a little
more oomph so percentage wise this should be miniscule?
--
Øyvind Harboe
http://www.zylin.com