Boost logo

Boost :

Subject: Re: [boost] GSOC 2015 : Project on Concurrent Hash Tables
From: Rob Stewart (rob.stewart_at_[hidden])
Date: 2015-03-06 05:01:45


On March 5, 2015 11:19:34 PM EST, Niall Douglas <s_sourceforge_at_[hidden]> wrote:
> On 6 Mar 2015 at 6:13, Amarnath V A wrote:
>
> > Say,
> > I performed a move construction of old_map and it was being used by
> > few threads, shouldn't I mark it for reloading by those threads.

This doesn't seem reasonable to me. Move semantics apply to temporaries, not to objects still in use. That applies to concurrent data structures, too. Otherwise, you have to copy the container so the container and its data are not yanked out from under other threads. Obviously, the onus is on the owner of the container to apply move semantics only when safe.

> > 3. How do I handle exceptions in move construction? On an exception,
> > what is the move construction expected to do? Just abort whatever it
> > was doing and restore the old_map?
>
> Exception safety means restoring the map to as if no change had
> happened with no resources leaked or data changed.

That's only true if you provide the strong guarantee.

___
Rob

(Sent from my portable computation engine)


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk