public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* [ECOS] is diag_printf thread safe?
@ 2006-06-12  6:21 saurabh prakash
  2006-06-12  6:50 ` Andrew Lunn
  0 siblings, 1 reply; 2+ messages in thread
From: saurabh prakash @ 2006-06-12  6:21 UTC (permalink / raw)
  To: ecos-discuss

hello,

i want to know

1) whether diag_printf() and printf()
   are thread safe?

2) is it safe to call them from a DSR

thnx in advance,
saurabh prakash

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [ECOS] is diag_printf thread safe?
  2006-06-12  6:21 [ECOS] is diag_printf thread safe? saurabh prakash
@ 2006-06-12  6:50 ` Andrew Lunn
  0 siblings, 0 replies; 2+ messages in thread
From: Andrew Lunn @ 2006-06-12  6:50 UTC (permalink / raw)
  To: saurabh prakash; +Cc: ecos-discuss

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2006-06-12  6:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-06-12  6:21 [ECOS] is diag_printf thread safe? saurabh prakash
2006-06-12  6:50 ` Andrew Lunn

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).