From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jonathan Larmour To: Sergei Slobodov Cc: ecos-discuss@sourceware.cygnus.com Subject: Re: [ECOS] interrupts always enabled in scheduler Date: Tue, 16 Jan 2001 17:19:00 -0000 Message-id: <3A64F30F.D5D06970@redhat.com> References: <3A64CEAE.4060300@caracal-tech.com> X-SW-Source: 2001-01/msg00273.html Sergei Slobodov wrote: > > I'm looking through the sources, trying to determine whether we should > try to use ecos or port our own kernel from another platform, and there > is at least one major issue I don't understand. ECOS seems to support > nested interrupts, yet there is no interrupt enable/disable pair around > the code that manipulates thread queues, such as Cyg_Thread::resume(), > which non-atomically changes global scheduler structures. Woudn't it > cause data corruption if a higher priority interrupt occurs in the > middle of resume() call? eCos has been designed to disable interrupts as infrequently as possible. No interrupt handler (ISR) will change the thread queues directly. The only protection needed is that provided by the scheduler lock ( which is locked using Cyg_Scheduler::lock()) which prevents pre-emption by other threads, _and_ pre-emption by a deferred service routine (DSR) which is the portion of the interrupt handling system which *is* allowed to change the thread queues. Only one DSR runs at a time, and these are scheduled outside of threads, i.e. no threads run while a DSR runs. Jifl -- Red Hat, Rustat House, Clifton Road, Cambridge, UK. Tel: +44 (1223) 271062 Un cheval, pas du glue. Pas du cheval, beaucoup du glue. || Opinions==mine