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.
bit a single atomic op, while expensive would be within the cost I could live with.
The theory: the closer in time independent messages are printed (on different cores), the least important their ordering becomes.
not necessarily. sometimes teh order is important to find the problem..
("look, it read it before the other one wrote it").
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "[email protected]"
