public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
From: andrew.lunn@ascom.ch (Andrew Lunn)
To: pyxue@t2-design.com (pengyu xue)
Cc: ecos-discuss@sourceware.cygnus.com
Subject: Re: [ECOS] dynamic allocation  memory
Date: Wed, 06 Sep 2000 00:30:00 -0000	[thread overview]
Message-ID: <200009060730.JAA01287@biferten.ma.tech.ascom.ch> (raw)
In-Reply-To: <Pine.LNX.4.21.0009061500180.5066-100000@Gaotian>

> Hi, all:
>  
>          I use the malloc function in my device driver, but it seems
> something is wrong with this function. 

You say device driver. Do you mean ISR and DSR? If so, its a bad idea
to use malloc. malloc will need to use some sort of mutex primitive to
protect its data structures from multiple threads executing it
simultaniously. ISR and DSR cannot block so these primitives don't
work. 

Somewhere there is a document which states which functions you can
call in a DSR/ISR. For mempools the try get function will probably
work, but you have to be prepaired for it to return no memory.

        Andrew

  reply	other threads:[~2000-09-06  0:30 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-09-06  0:10 pengyu xue
2000-09-06  0:30 ` Andrew Lunn [this message]
2000-09-06  5:17 ` Gary Thomas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200009060730.JAA01287@biferten.ma.tech.ascom.ch \
    --to=andrew.lunn@ascom.ch \
    --cc=ecos-discuss@sourceware.cygnus.com \
    --cc=pyxue@t2-design.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).