This is the mail archive of the ecos-discuss@sources.redhat.com 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: regarding printfs


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

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
suheelh@nc.rr.com




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


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