M68k C++ Exceptions working!

Quality Quorum qqi at world.std.com
Fri Jan 14 16:19:29 UTC 2000



On Fri, 14 Jan 2000, Joel Sherrill wrote:

> 
> 
> Charles-Antoine Gauthier wrote:
> > > What do you imagine, is making exceptions not thread safe ?
> > > Some description here might to come up with some test cases.
> > 
> > I don't have it in front of me now, but I seem to recall that the text
> > in the gcc source tree that describes the exception processing mechanism
> > was quite clear that exception handling was not multithread safe. Global
> > variables are used by the low-level exception handling code. If a
> > context switch were to occur while the system was looking for an
> > exception handler and another exception was raised, good luck when the
> > first thread is re-dispatched.
> > 
> > Use of a per-thread context was described as future work.
> 
> Another option ... RTEMS COULD:
> 
>   + use the --enable-cplusplus configure option to add this context
>     switch to each task.  OR
>   + add a per task variable for this but it would have to be registered
>     so early in the task life that it would likely require adding a
>     C++ specific user extension like the newlib one.
> 
> > > I imagine that an exception carring some data, and it been propagated a
> > > few levels( 3 or 4 )
> > > could be a start for a test. I have put together a test case for that.
> > > it seems to run fine on PC386.
> > > In a thread safe environment, the data holded by each instance of the
> > > exception class should be kept
> > > consistent.
> > 
> > Yes, but that is an application programming problem, IMHO. 
> 
> But the tools should work regardless.
> 
> > One should
> > not 'throw' shared objects around unless it is safe to do that.
> 
> That sums up a lot of concurrent programming problems.

What about supporting EC++ subset to being with (or EC++ plus templates) ?  

> > Charles-Antoine Gauthier

> Joel Sherrill, Ph.D.             Director of Research & Development

Thanks,

Aleksey




More information about the users mailing list