Re: sched_lock && thread_lock()



On Thu, 24 May 2007, Attilio Rao wrote:

Hello,
Let me know if this patch is right for you and if you have feedbacks, comments, etc:
http://users.gufi.org/~rookie/works/patches/schedlock/vmmeter3.diff

This should fix translation errors Bruce has found and switching the _SET() method in order to being a simple assignment (as Bruce has suggested).

OK.

Note that I won't be really happy until the macros and volatiles go
away. But keep at least the macros for development. The volatiles
are easier to remove: put them in the access macros instead of putting
them in the declarations and cancelling them in the access macros where
they are most needed. This would leave them broken in the access
macros where they are most needed, the same as now (since the sysctl
macros just don't support volatile, they must be cancelled now and
cannot be added). Note that we use this method for almost all "volatile"
variables in the kernel -- we don't declare quite enough things volatile,
but we add volatiles in the atomic function calls and depend on a
combination of atomic accesses and locking to avoid races. It is easy
to get this wrong, but if we get it wrong then declaring things volatile
only reduces the races.

I forgot to mention another easy-to-fix bug: missing parentheses around
the `val' arg in macro definitions.

Bruce
_______________________________________________
freebsd-arch@xxxxxxxxxxx mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-arch
To unsubscribe, send any mail to "freebsd-arch-unsubscribe@xxxxxxxxxxx"



Relevant Pages

  • Re: Noob to C++, trying to get syntax, etc.
    ... or they can move declarations to separate files. ... The console stream object, cout, passes into greetby reference. ... When templates and macros call operator<<, ... C++ macros provide some important features above the level of the actual ...
    (comp.lang.cpp)
  • Re: Declarations variables, Dim, some guidance please
    ... My uses of 'declared' vars in most cases, fall into all of the categories ... declared: dim PressEnter as string ... it's kinda a good thing for me that other macros ... >> variables in Declarations. ...
    (microsoft.public.excel.programming)
  • RE: Declarations variables, Dim, some guidance please
    ... I have a sub called zRM_Values which is called at the begining of larger ... declared: dim PressEnter as string ... it's kinda a good thing for me that other macros ... > Good coding practice is to use global or module level variable declarations ...
    (microsoft.public.excel.programming)
  • Re: Declarations variables, Dim, some guidance please
    ... My uses of 'declared' vars in most cases, fall into all of the categories ... declared: dim PressEnter as string ... it's kinda a good thing for me that other macros ... > placing in Declarations or a procedure. ...
    (microsoft.public.excel.programming)
  • Re: advantages of C
    ... declarations at the top of a scope seems perfectly fine for me. ... Bizarrely the C99 people picked this feature up for some reason. ... as any kind of real solution for removing macros. ... created this namespace incompatibility problem with C. ...
    (comp.programming)