Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Is there penalty for reference counting in Mat?

Recently I read Herb Sutter's paper Optimizations That Aren't (In a Multithreaded World) and discovered that reference counting (that should be an optimization) may cause huge performance loss if program is multithread-safe (even if it is running in single thread). That is exactly my situation: I write programs that run in single thread but they are part of complex multithreaded process.

So my questions are: Is Mat multithread safe? Is there penalty for reference counting? If yes, how big it is?