Re: The idea of disabling interrupts



On Nov 29, 12: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

Please define share more precisely.

If only one thread is writing to data, and other thread(s) is reading
data only, then no need for the things you requested. Producer/
consumer buffers are typically implemented as such.
.



Relevant Pages

  • Re: The idea of disabling interrupts
    ... If you're sharing your data with an ISR, it is often the only thing you ... disable interrupts for a short period, and you don't call any OS/library ... Thx for the info. Interesting:):) ...
    (comp.arch.embedded)
  • Re: The idea of disabling interrupts
    ... disable interrupts for a short period, and you don't call any OS/library ... Thx for the info. Interesting:):) ... And if you have an OS that supports semaphore/Mutex, ... want to avoid using them? ...
    (comp.arch.embedded)
  • Re: Is fractal art part of the science of fractals?
    ... THX ... > dave wrote: ... I know of no other way of highlighting to make a point in ... >> a plain text message. ...
    (sci.fractals)
  • Re: keyword not highlighting
    ... keywords function and return are not highlighting. ... possible reasons?? ...
    (microsoft.public.vsnet.general)
  • keyword not highlighting
    ... keywords function and return are not highlighting. ... possible reasons?? ...
    (microsoft.public.vsnet.general)