This is the mail archive of the ecos-discuss@sourceware.org mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: is diag_printf thread safe?


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]