This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

C++ exceptions and multithreading


Having looked at the code, I've pieced together the following:

unwind-sjlj.c (for which I can't find the source in eCos, I presume
this is part of GCC) uses a fc_static global variable to track the
current
frame context(verified in a debug session) => eCos is limited to 
supporting exception handling for a single thread.

http://savannah.gnu.org/cgi-bin/viewcvs/gcc/gcc/gcc/unwind-sjlj.c?rev=HE
AD&content-type=text/vnd.viewcvs-markup


There is one idea that immediately strikes me w.r.t. adding
multithreaded
C++ exceptions to eCos:

1. change definition of fc_static in unwind-sjlj.c to be a globally
visible
variable.
2. add a fc_static entry to the thread structure
3. for every thread context switch, save off the global fc_static
into the thread structure and restore the global fc_static from the
next running thread. 


*If* the above scheme works, I could make the changes easily enough.

Comments?


Øyvind


--
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]