Skip to content
CodeWiki
Practice
Paths
Tracks
Cheatsheets
Playground
Glossary
AI era
Search
⌘K
English
English
Chinese
Practice
Paths
Tracks
Cheatsheets
Playground
Glossary
AI era
English
English
Chinese
Practice
/
Quiz
/
C++
/
Smart pointers
Which C++23 statement about shared_ptr and threads is correct?
from Smart pointers
C++23 (GCC 13.3.0)
advanced
1 min
Which C++23 statement about shared_ptr and threads is correct?
Different shared_ptr objects may share a control block across threads, but the managed object still needs its own synchronization.
Reference counting makes every field of the managed object atomic.
Two threads may call reset concurrently on the same ordinary shared_ptr variable without synchronization.
weak_ptr::expired keeps the target alive until the next statement.
Check
Ask AI about this kata
Report an error
previous kata
What happens when a shared_ptr is copied?
Quiz
next kata
Spot the bug in the shared_ptr factory
Spot the bug
A new version is available
Reload