On Fri, 23 Sep 2011, Alan Cox wrote:
> It's a very sane default because the performance difference is
> astronomical
I disagree. I do not see how having a thread which obtained a lock
be the one which releases it causes any performance change. The same
amount of unlocking is done.
> > #ifdef __linux__
> Far better is
> if (defined __linux__) && defined(DEBUG_MUTEXES)
Better name would
defined(NON_PORTABLE_MUTEXES)
linux is the only system I've encountered which doesn't use the
concept of thread ownership. And it was a big pain to port a program
written to use the 'ownerless mutex' concept to systems which did
use that concept.
If the program is written to use the concept of thread ownershio (by
turning on either DEBUG_MUTEXES or NON_PORTABLE_MUTEXES) then WHERE
is the performance difference coming from? Turning that option off
would make it easy to produce non portable threaded code.
> then you can build for debug or for performance as needed with a compile
> option.
To me it is an egregious error for a thread which did not lock a
mutex to unlock it -that's the way it's been for as long as I can
remember. It has, in MY experience, always been a logic or design
error for a thread to unlock a thread of which is it not the owner.
> Even better still for many applications is not using pthreads in the
OK with me. When I see the mjpegtools rewritten into whatever
replaces pthreads I'll believe it ;)
> first place. The fundamental models pthreads use are basically
> 'everything is shared, nothing is locked unless you remember to do so'
we have to live within the confines of the pthreads model unless
someone volunteers to
Wasn't trying to start a religious argument and it seems the reference
to brain dead did push a hot button. Was simply pointing out
that the default behaviour of a system that many use is not as
portable as many would like to think. Java -> /dev/null
Steven Schultz
------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security
threats, fraudulent activity, and more. Splunk takes this data and makes
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2dcopy2
_______________________________________________
Mjpeg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mjpeg-users