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: Blocking restricted in DSRs


On Mon, 2004-07-26 at 14:13, Bob Koninckx wrote:
> Things like waiting for a semaphore. Blocking is something you do at
> thread level. The thread "blocks" (or goes to sleep) until another
> thread or interrupt wakes it up again. Basically, this waking up is done
> by the scheduler, which explains why you should not block in a DSR,
> which is called _before_ the scheduler. 
> 

Actually, more importantly, DSR's can't be allowed to block because
they have no thread context of their own (they run anonymously without
any explicit context)

My definition of "blocking" would be any operation which requires 
the current thread to lose control over the CPU.  Examples would be
waiting for resources like semaphores, mutexes, etc.  Any time a thread
has to wait, its context needs to be saved so the CPU can be returned
to the thread when it becomes ready again.  Without a [thread] context,
such waiting is impossible.

> Hope this makes it a little bit clearer,
> 
> Bob
> 
> 
> On Mon, 2004-07-26 at 21:01, Miguel J. Vega wrote:
> > Hi everyone,
> > 
> > I have read that DSRs should not include calling functions that "block".
> > What exactly is meant by "blocking"?
> > 
> > Thanks,
> > 
> > Miguel J. Vega
> > FEGI C&DH Team
> > University of Michigan
-- 
Gary Thomas <gary@mlbassoc.com>
MLB Associates


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]