Re: The idea of disabling interrupts
- From: karthikbalaguru <karthikbalaguru79@xxxxxxxxx>
- Date: Fri, 30 Nov 2007 00:11:50 -0800 (PST)
On Nov 29, 2:15 pm, Arlet Ottens <usene...@xxxxxxxxxx> wrote:
karthikbalaguru wrote:
If you're sharing between two tasks, it depends. Generally, if you
disable interrupts for a short period, and you don't call any OS/library
functions, it can be a useful method. Exactly how long you can disable
interrupts depends on your environment and real-time requirements.
Thx for the info. Interesting :):)
Thinking over this, i have a query -
Is it possible to do sharing of data(Critcal Section) wihtout diabling
of interrupts and also
without the use of these RTOS features like semaphore/Mutex/
MessageQueues/Pipes/Mailboxes ?
Sometimes you can use atomic instructions, if your CPU has them. For
instance, the ARM has the SWP instruction that can be used to solve some
concurrency problems.
The other possibility is to not use a preemptive RTOS. You can either
use a non-preemptive (cooperative) OS, or not use an OS at all. I've
implemented quite a few embedded systems that just had a polling loop,
and a bunch of ISRs. In some cases, the ISRs did the bulk of the work,
so there wouldn't be any concurrency issues, and the timing was guaranteed.
Thx for the info.
I thought of such a similar idea - The idea of using flags w.r.t
interrupts.
Enable a flagA and manipulate the part A
(shared data) in task code and as flagA is enabled, manipulate the
part B
in the ISR. And vice versa for part B(Shared Data).
Though this replaces the idea of disabling interrupts,
this is time consuming.
Karthik Balaguru
.
- Follow-Ups:
- Re: The idea of disabling interrupts
- From: ssubbarayan
- Re: The idea of disabling interrupts
- References:
- The idea of disabling interrupts
- From: karthikbalaguru
- Re: The idea of disabling interrupts
- From: Arlet Ottens
- Re: The idea of disabling interrupts
- From: karthikbalaguru
- Re: The idea of disabling interrupts
- From: Arlet Ottens
- The idea of disabling interrupts
- Prev by Date: Re: OT:C/C++ Opinion Poll
- Next by Date: Re: The idea of disabling interrupts
- Previous by thread: Re: The idea of disabling interrupts
- Next by thread: Re: The idea of disabling interrupts
- Index(es):
Relevant Pages
|