[ECOS] ECOS: fatal error!

Iztok Zupet iz@vsr.si
Wed Jun 26 03:41:00 GMT 2002


On Wednesday 26 June 2002 11:12, zhlg_shuhan wrote:
> Hi,everyone!
>     as you know,scheduler::lock()/unlock() can't settle down race
> conditions for mutithread accessing scheduler's data structure,such as
> threadQueue. for example, current thread was accessing thread
> queue(add_thread_to_list())with lock() taking  when a interrup occurs,this
> interrupt also accessing threadqueue,so race condition for thread queue
> occurs,because lock(0/unlock()simply do "schedLock++/--",it can't resolve
> this BIG problem!
>   Right?
>
>                                                    zhlg
> ______________________________________
>
> ===================================================================
> ÐÂÀËÃâ·Ñµç×ÓÓÊÏä (http://mail.sina.com.cn)
> ÐÂÀË·ÖÀàÐÃ
Ï¢£º¶þÊÖÊг¡×ßÒ»×ߣ¬¸Ã³öÊÖʱ¾Í³öÊÖ£¡
> (http://classad.sina.com.cn/2shou/)

Hi

  I think, that You just can't access the scheduler queue from an interrupt 
(ISR) routine! No way. What you need to do is to write a DSR for Your ISR and 
in that DSR You can only set up a driver condition to notify a normal thread 
waiting for it, which can access the scheduler queue after the condition 
becomes true. 
Only a normal thread can access the scheduler queue, if You want to be safe, 
not the ISR (interrupt service routine) or DSR (deferred service routine).

Regards
iz


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



More information about the Ecos-discuss mailing list