Ownership transfer
Ownership transfer is the reassignment of responsibility for managing a value or resource from one entity to another.
C++ Concurrency in Action, Second Edition
Ownership transfer is the reassignment of responsibility for managing a resource, such as a lock, from one entity to another.
- How it is used
- Manages thread and mutex ownership across objects, functions, and scopes in concurrent C++ code.
- How deep it goes
- Walks through thread and lock transfers, including implicit moves and a thread-assignment termination pitfall, without detailing move internals.
- Examples
- Uses thread transfers among three objects and a function that returns a lock for continued protected work.
- What you can do after
- Apply `std::move` to transfer from named owners and avoid assigning over an associated `std::thread`.
Read how C++ Concurrency in Action, Second Edition explains ownership transfer →
Learn Rust in a Month of Lunches
Ownership transfer is the movement of a value's controlling ownership from one binding or function to another.
- How it is used
- Uses ownership transfer to clarify how Rust controls access to values during an introduction to memory and ownership.
- How deep it goes
- Explains transfer through an analogy and contrasts it with references and Copy types, but does not show transfer syntax or compiler feedback.
- Examples
- Uses a coworker taking ownership of a computer and compares Copy types with pens, paperclips, and sticky notes.
- What you can do after
- Evaluate whether an example represents transferred ownership, borrowing through references, or inexpensive copying.
Read how Learn Rust in a Month of Lunches explains ownership transfer →
100 C++ Mistakes and How to Avoid Them
Ownership transfer is the operation of changing which object is responsible for managing a resource.
- How it is used
- Uses exclusive ownership to prevent raw-pointer lifetime errors when a resource moves between parts of a program.
- How deep it goes
- Explains pointer-copy failure, RAII limitations, and unique_ptr-based correction with pointer and array examples.
- Examples
- Contrasts copied Buffer pointers that are deleted twice with unique_ptr objects transferred using std::move.
- What you can do after
- Apply it via std::unique_ptr and std::move to transfer exclusive ownership while avoiding manual resource deletion.
Read how 100 C++ Mistakes and How to Avoid Them explains ownership transfer →
Related concepts
- unique_lockused by · std::unique_lock is a C++ standard library class template that manages exclusive ownership of a mutex and supports deferred locking, unlocking, and ownership transfer.
- channelimplemented by · A channel is a medium, mechanism, or pathway through which information or messages are conveyed between participants or endpoints.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.


