From mboxrd@z Thu Jan 1 00:00:00 1970 From: Hugo Tyson To: ecos-discuss@sources.redhat.com Subject: Re: [ECOS] bypass DSR, sem_post from ISR Date: Fri, 25 May 2001 03:01:00 -0000 Message-id: References: <20010524202755.43465.qmail@web12101.mail.yahoo.com> X-SW-Source: 2001-05/msg00440.html Phung Te Ha writes: > Hi everyone, > > I have an interrupt handling which needs reschedule > (cyg_thread_delay and mutex_lock) so I have the real > service in a thread. > > My question is that is it safe to call cyg_sem_post > directly from the ISR and start my service thread > rather than start the DSR and wait for this one to > call cyg_sem_post? No. You should understand that the delay to calling the DSR is usually zero. DSRs are called during the return-from-interrupt sequence - if it is safe to do so. DSRs are only delayed if the thread that was interrupted had locked the scheduler for some other reason - such as doing scheduling operations itself. If all your threads are asleep, or just doing "calculations" ie. not calls in to eCos' scheduler, then DSRs will certainly run immediately, right after the ISR. - Huge