This is the mail archive of the
ecos-discuss@sourceware.org
mailing list for the eCos project.
Re: is diag_printf thread safe?
- From: Andrew Lunn <andrew at lunn dot ch>
- To: saurabh prakash <saurabhp75 at gmail dot com>
- Cc: ecos-discuss at ecos dot sourceware dot org
- Date: Mon, 12 Jun 2006 08:50:46 +0200
- Subject: Re: [ECOS] is diag_printf thread safe?
- References: <eafe42230606112321n14199611id86bbd3476aeeb95@mail.gmail.com>
On Mon, Jun 12, 2006 at 11:51:04AM +0530, saurabh prakash wrote:
> hello,
>
> i want to know
>
> 1) whether diag_printf() and printf()
> are thread safe?
They won't crash/cause corruption if two or more threads call them
simultaneously. You might get interleaved output. You would need to
check where the isr disable/mutex lockigng is respectively.
> 2) is it safe to call them from a DSR
printf no. diag_printf() can be called from ISR, DSR, threads etc.
Andrew
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss