[dtrace-discuss] What am I missing in the dtrace script?

Bryan Cantrill bmc at eng.sun.com
Thu Jul 12 22:20:08 PDT 2007


On Thu, Jul 12, 2007 at 05:47:50PM -0700, Brian D. Horn wrote:
> Wee Yeh Tan wrote:
> > On 7/13/07, Brian D. Horn <Brian.Horn at sun.com> wrote:
> >> Ok, then the question becomes "Where is documented that aggregates are
> >> MP safe, but scalars are
> >> not MP safe?"
> >
> > Hah... I sort of saw that coming.  I recall seeing this somewhere
> > though I cannot remember exactly where.  Didn't see it in Bryan's
> > DTrace gotchas.
> >
> > Does this warrant a bug against the documentation?  Perhaps a note in
> > the variables section saying that "Global variables are not MP safe."?
> >
> I don't know whether it is a bug or not yet.  I may have missed some
> piece of documentation or seen old documentation.  It also begs the
> question of "Why was it decided that scalars should not be MP safe?"
> (assuming that is was decided as such!).

It _was_ decided as such, and it's because global scalars -- MP-safe or
not -- do not scale.  Indeed, we could quite easily make increment
and decrement MP-safe, but I have resisted it because it sends the 
wrong message:  global scalars are almost always the wrong tool for the
job; as I instructed you, you should be using aggregations for this
instead.  If you'd like to file a bug against the documentation for this
to be more clearly spelled out, feel free...

	- Bryan

--------------------------------------------------------------------------
Bryan Cantrill, Solaris Kernel Development.       http://blogs.sun.com/bmc


More information about the dtrace-discuss mailing list