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: question about Synchronization Levels in eCOS? Thanks alot.


On Tue, May 06, 2003 at 02:25:29PM +0100, QiangHuang wrote:
> Thanks Gary.
> 
> 
> Suppose the following:
> 
> thread1( )
> { 
> 
> cyg_flag_wait( &flag );
> 
> }
> 
> isr( )
> {
> // if cyg_flag_setbits(&flag) called here what problem would be?
> }

The kernel could be in the process of awakening thread1 from the
previous ISR when the current ISR goes off. ie its part way through
cyg_flag_wait(&flag), when the ISR goes off and changes the value of
flag without it realizing. Things can then go wrong. 

However, DSR are called at safe times when changing such variables
will not cause a problem since it 100% sure its not half way though a
cyg_flag_wait operation.

          Andrew

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