Add a bench and test for SkRefCnt. This also adds a SkThread class with enough ...
12 years, 8 months ago
(2012-05-10 22:17:30 UTC)
#1
Add a bench and test for SkRefCnt. This also adds a SkThread class with enough
function to support the tests. This has been tested to work on Win, Linux, and
Mac. On each platform replacing the SkThread_<something>.cpp with
SkThread_none.cpp resulted in the test failing most of the time.
http://codereview.appspot.com/6195071/diff/11003/src/utils/SkThreadUtils.h File src/utils/SkThreadUtils.h (right): http://codereview.appspot.com/6195071/diff/11003/src/utils/SkThreadUtils.h#newcode12 src/utils/SkThreadUtils.h:12: Should this ever be subclassed? If so, should the ...
12 years, 8 months ago
(2012-05-11 12:53:19 UTC)
#2
Added comments and fixed up affinity, since it the implementation wasn't too clear about what ...
12 years, 8 months ago
(2012-05-11 21:59:46 UTC)
#3
Added comments and fixed up affinity, since it the implementation wasn't too
clear about what it did either.
http://codereview.appspot.com/6195071/diff/11003/src/utils/SkThreadUtils.h
File src/utils/SkThreadUtils.h (right):
http://codereview.appspot.com/6195071/diff/11003/src/utils/SkThreadUtils.h#ne...
src/utils/SkThreadUtils.h:12:
On 2012/05/11 12:53:19, reed1 wrote:
> Should this ever be subclassed? If so, should the destructor be virtual? Can
it
> ever be copied? If not, should it subclass from SkNoncopyable?
I don't think this should ever be subclassed. Making the destructor non-virtual
should be at least vague documentation. Even Java has abandoned the idea of
subclassing a Thread class, favoring Runnables (which are passed to a Thread),
or more recently, Futures (but that's a whole other can of worms). It shouldn't
ever be copied. Will make SkNoncopyable.
http://codereview.appspot.com/6195071/diff/11003/src/utils/SkThreadUtils.h#ne...
src/utils/SkThreadUtils.h:17: ~SkThread();
On 2012/05/11 12:53:19, reed1 wrote:
> What does the bool mean?
The bool is for whether it worked or not. I figured there should be some
immediate feedback available as to whether the start failed.
http://codereview.appspot.com/6195071/diff/11003/src/utils/SkThreadUtils.h#ne...
src/utils/SkThreadUtils.h:19: void join();
On 2012/05/11 12:53:19, reed1 wrote:
> What does this method do? What is the parameter? What is the bool?
The bool is for if it worked or not. The parameter is magic and basically means
that if different Threads are setup with different processors, this is a request
that the threads run on different cores.
http://codereview.appspot.com/6195071/diff/7004/src/utils/SkThreadUtils.h File src/utils/SkThreadUtils.h (right): http://codereview.appspot.com/6195071/diff/7004/src/utils/SkThreadUtils.h#newcode14 src/utils/SkThreadUtils.h:14: public: Nit: most of the newer comments in skia ...
12 years, 8 months ago
(2012-05-14 13:37:15 UTC)
#4
Issue 6195071: Add bench and test for SkRefCnt.
(Closed)
Created 12 years, 8 months ago by bungeman
Modified 12 years, 8 months ago
Reviewers: reed1
Base URL: http://skia.googlecode.com/svn/trunk/
Comments: 7