Re: The idea of disabling interrupts



On Nov 30, 10:11 am, Ed Prochak <edproc...@xxxxxxxxx> wrote:
On Nov 29, 3:42 am, karthikbalaguru <karthikbalagur...@xxxxxxxxx>
wrote:





On Nov 29, 12:21 pm, Arlet Ottens <usene...@xxxxxxxxxxxxxxxxx> wrote:

karthikbalaguru wrote:
Is it a good idea to disable interrupts while sharing data (Critical
Sections) ?

If you're sharing your data with an ISR, it is often the only thing you
can do (unless your CPU has the right atomic instructions for the job).

Thx for highlighting this :):)

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 ?

Thx in advans,
Karthik Balaguru

If you have an OS that supports MessageQueues/Pipes/Mailboxes, why do
you want to avoid them?
And if you have an OS that supports semaphore/Mutex, why would you
want to avoid using them?

Semaphores were created for dealing with critical section issues.why
not use the right tool for the job?

I was just thinking of a way of avoiding
the disabling of interrupts by our own programming
rather than depending on the RTOS features.

Karthik Balaguru
.



Relevant Pages

  • Re: sony vaio pcg-gr390
    ... PCI-Only Interrupts: none ... Location Bus Device Pin Link IRQs ... penalty: 1050 ... isa_probe_children: disabling PnP devices ...
    (freebsd-current)
  • Re: [RFC/PATCH] Kdump: Disabling PCI interrupts in capture kernel
    ... I know very little about consoles and their working. ... >> console driver needed interrupts to be enabled at the controller. ... looking at disabling the DMA from the devices. ... interrupt disable bit in PCI-PCI bridge is optional and if implemented, ...
    (Linux-Kernel)
  • Re: [RFC] mmiotrace full patch, preview 1
    ... the "first" probe gets selected and executed. ... kmmio_handler, where-ever it was triggered, executes with interrupts ... enable single-stepping. ... or does disabling interrupts guarantee that? ...
    (Linux-Kernel)
  • Re: Guarantee Critical Regions in Portable code. Portable Semaphores?
    ... Disabling interrupts is the kernel level operation. ... You cannot know it's safe for sure, but a single increment or decrement ... How can the FAT driver know when it is safe to disable the interrupts ...
    (comp.arch.embedded)
  • Re: IIgs Debuggers?
    ... Are you directly disabling any interrupts? ... I do disable interrupts on the initial loading of the wavebank into the DOC RAM, but I do so *exactly* as you have mentioned. ... I deliberately chose MIDI Synth sequences that all share the same instruments and wavebank file - thereby eliminating the need to reload them. ...
    (comp.sys.apple2.programmer)