December 2001
Intermediate to advanced
304 pages
6h 25m
English
Difficulty: 8
In this final chapter of the miniseries, we consider the effects of thread safety on copy-on-write strings. Is lazy copy really an optimization? The answer may surprise you.
Why is Optimized::String (from Item 15) not thread-safe? Give examples.
Demonstrate how to make Optimized::String thread-safe:
assuming there are atomic operations to get, set, and compare integer values; and
assuming there aren't.
What are the effects on performance? Discuss.
Standard C++ is silent on the subject of threads. Unlike Java, C++ has no ...
Read now
Unlock full access