svn commit: r231814 - in head/sys: kern sys

Marcel Moolenaar marcel at xcllnt.net
Fri Feb 17 17:03:15 UTC 2012


On Feb 16, 2012, at 11:45 PM, Julian Elischer wrote:
*snip*
>> The message buffer does not have to be a chunk of memory that
>> we circularly scribble to. It can be a per-cpu linked list of
>> messages even.
*snip*

> that is an intersting thought.. though.. how would you sort them into order for
> printing?
> 
> maybe a single atomic 64 bit int that is incremented per message.

Yes. Though, a timestamp should do the trick as well. In a multi-core
system, you won't have pure or absolute sequentially anymore. For
messages that are "printed" at the proverbial "same time" on different
cores, ordering is very hard, if not impossible, to determine. A single
atomic counter would force sequentially, but would effectively introduce
serialization, just like locking, and would make a per-cpu message
buffer/list/whatever less useful.

The theory: the closer in time independent messages are printed (on
different cores), the least important their ordering becomes.

-- 
Marcel Moolenaar
marcel at xcllnt.net




More information about the svn-src-head mailing list