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: some issues relating to current_thread


Brij Bihari Pandey <fuzzhead012@yahoo.com> writes:

> Two situation where the condition
> 
> "if( this == Cyg_Scheduler::get_current_thread() )"
> 
> will fail I could figure out earlier..(as mentioned in
> [2]) but couldn't get the idea of when one thread
> would deliberately like to deliver exception to
> itself, to some other thread? and why would that be
> required if whenever required? This is what didn't
> become clear to me.

There are situations, in testing and debugging for example, where it
might be useful to deliver exceptions to other threads. But generally
it is not useful, hence we have put no effort into making it work.


> I am still going through the code, but as I get from your mail,
> interrupts can still come. Is there any interrupt related code that
> can refer to current_thread? I guess.. all the ecos design/code you
> have done will not have such situations..

Interrupt code cannot do anything to interact with the kernel except
request that its DSR be run. The DSR runs only when the scheduler data
structures are in a consistent state. Even when the DSR runs, the
identity of the current thread is mostly irrelevant.

> This brings me to another naive question, as I am not much aware of
> architectures other than Intel, are all the hardware designs are
> same way?
> 

Yes. It makes no sense to have any kind of disable on exceptions.
Exceptions are synchronous, caused by the executing code, if you could
inhibit exceptions the CPU would have nowhere to go.

-- 
Nick Garnett - eCos Kernel Architect
http://www.eCosCentric.com/


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