[ECOS] Re: regarding printfs

Suheel Hussain suheelh@nc.rr.com
Wed Nov 26 03:56:00 GMT 2003

Hi Vinay,

Most printfs works like this:

the printf output is generally sent to a console or std serial output 
device. When printf is invoked, the function generates a character string, 
from argument specified in printf call, and sends generated string to serial 

In some systems, serial driver copies this string into its local buffers and 
sends it to device when possible -- i.e., asynchronous or non-blocking mode. 
In other implementation serial driver blocks printf until all string 
characters are successfully sent -- i.e., blocking mode.

 From your description it seems like you have timing issue. The printf call 
may generate enough delay to make system "work." BTW, your 
application/program should not have to do a mutex lock during printf, the 
serial driver should make sure that buffering is done atomically.

Hope this helps.

Suheel Hussain

Main #: (919) 676-7568
Mobile #: (919) 624-0901

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

More information about the Ecos-discuss mailing list