Re: regarding ISR



<aleemakhtar1@xxxxxxxxx> wrote in message
news:b140416d-2767-40e2-b8f6-d3d8e91ea71f@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
can i allocate dynamic memory in ISR ?? If yes wat shd be the
precautions i need to take care ??

In most systems, the answer is NO.

Reasons:

a)Functions such as malloc() are typically not re-entrant.

b)The allocation would take too long (defeats the rationale of an ISR).

Generally, knowing what you may and may not do from within an ISR is one of
the really important design rules of a system ...

--
David T. Ashley (dta@xxxxxxxx)
http://www.e3ft.com (Consulting Home Page)
http://www.dtashley.com (Personal Home Page)
http://gpl.e3ft.com (GPL Publications and Projects)


.



Relevant Pages

  • Re: Reentrant functions and memory allocation
    ... Why are people talking about malloc being or not being re-entrant? ... don't see the definition of malloc, so we don't care if it calls ... As for malloc being called from within a re-entrant function, ... the C standard doesn't guarantee that malloc is thread-safe. ...
    (comp.lang.c)
  • Re: goto across functions/isrs?
    ... (Few compiler support it). ... It is a always advisable to keep ISR ... re-entrant on and older version of IAR 8051. ... If one had XDATA space, one could switch to a different memory model, ...
    (comp.arch.embedded)
  • Re: goto across functions/isrs?
    ... (Few compiler support it). ... It is a always advisable to keep ISR ... re-entrant on and older version of IAR 8051. ... If one had XDATA space, one could switch to a different memory model, ...
    (comp.arch.embedded)
  • Re: whats a callback?
    ... John Larkin wrote: ... > The isr is not re-entrant. ... or nested invocations which will not interfere with each ...
    (comp.arch.embedded)
  • Re: whats a callback?
    ... John Larkin wrote: ... > The isr is not re-entrant. ... or nested invocations which will not interfere with each ...
    (sci.electronics.design)