This is the mail archive of the ecos-discuss@sourceware.org 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: Interrupt vs Thread - shared resource


> From: Szentirmai Gergely
>
> I describe my problem with a simplified example: I have a thread, which
> works with a buffer, and an ISR (or DSR), which would add some byte to
> this buffer too, so it is a shared resource. Since it is unable wait for
> a flag, or mutex in ISR, when the thread's code working with the buffer,
> the interrupt can jam the data.
> The only solution is to disable the interrupt for that critical section
> in the thread? Isn't there a better solution?

The usual method is to use a DSR, not an ISR, and then lock the scheduler in
the thread.

--

Ciao,               Paul D. DeRocco
Paul                mailto:pderocco@ix.netcom.com


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