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]

Re: R: Thread identification


"Michele Portolan" <michele.Portolan@imag.fr> writes:

> I'm conducting a study on fault tolerance, so I need to know which thread
> had been interrupted to try to recover the error.

Getting the identity of the current thread for simple monitoring
purposes is probably OK. However, if you want to try an affect the
state of the thread then you are on shaky ground. Interrupts can
happen even while a thread is in an inconsistent state, since thread
state is protected by the scheduler lock and not by disabling
interrupts. Any attempt to manipulate a thread from an ISR will result
in undefined behaviour.


> Does cyg_thread_self works also inside an exception?

Yes. In this case you are in safer territory since exceptions are
synchronous with the current thread and any exception raised should
see the thread in a consistent state -- unless something is seriously
wrong and the kernel has hit an exception.

-- 
Nick Garnett                    eCos Kernel Architect
http://www.ecoscentric.com/     The eCos and RedBoot experts


-- 
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]