Date: Fri, 10 Nov 2000 03:17:31 -0800 (PST) From: opentrax@email.com To: msmith@FreeBSD.ORG Cc: bright@wintelcom.net, duan@cs.umn.edu, freebsd-hackers@FreeBSD.ORG Subject: Re: printf() Message-ID: <200011101117.DAA01311@spammie.svbug.com> In-Reply-To: <200011101034.eAAAYk906022@mass.osd.bsdi.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On 10 Nov, Mike Smith wrote: >> >> Does the kernel function printf() flushes the output immediately, or it is >> >> possible some data is buffered somewhere and gets lost without printing >> >> to the console? like the corresponding funtion in the c library. >> > >> > It's not buffered afaik. >> > >> Actually my experince in writing drivers (for 386bsd) showed (me) >> that the kernel printf() was buffered. > > Considerable (ie. shitloads) of experience using the kernel printf with > FreeBSD (not to mention reading the code line by line as I ported it for > libstand) allows me to tell you that it isn't. > > And you're welcome to go read the code yourself, should you choose to > take issue with that. 8) > Sir, with regards to your experience and reading of the code, I should say that as you have read it, that would appear to be the situation. Better judgement - and testing to see how it might be buffered - would seem to be a challange. However, before we quest into what might be a futile battle on the definition of a word. Let's first agree that taken the code at face value you are correct. I will certainly not deny - code taken on face value to be code taken on value. Let us also agree that "buffering" might be defined in different ways. For instance, we could say, "buffering implies an actual level of intermediate storage that might (for some unknown reason) be delaying the output of a printf()" Show that be the case, then it would stem that our differences are minor, and could simply be a difference in interpetation or meaning of the word "buffered". As such, let me NOT blather on with meaningless dribble. Let us say, if we might, that there could be a delay in output two (2) seperate kernel printf() statements. Or said an other way, Is it possible for two (2) printf() statements NOT to be outputed in a linear fashinon? Ie. the first printf() statement get printed first, the second - second. If we differ on this point, then perhaps a example might be needed. As such, my example would only work under 386BSD, as I stated. Being your stated experience with FreeBSD, it is quite possible that I am incorrect. Should that be the case, then I stand correct. However, I see no evidence to such. Further my understanding or *BSD kernels, could be skewed, but past experience tells me otherwise. Is there is way that I could perhaps demonstrate my reasoning, such that it might be satisfactory to you? best regards, Jessem. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200011101117.DAA01311>