Boost logo

Boost :

Subject: Re: [boost] boost atomic question
From: Janek Kozicki (janek_listy_at_[hidden])
Date: 2010-04-30 12:03:51


edouard_at_[hidden] said: (by the date of Fri, 30 Apr 2010 17:12:50 +0200)

> On Fri, 30 Apr 2010 17:04:53 +0200, Janek Kozicki <janek_listy_at_[hidden]>
> wrote:
> > What would it take to get this code to work?
> >
> > std::vector<boost::atomic<Something> > v;
> > v.resize(100);
>
> Hi Janek,
>
> I'd like to know what's your goal when you declare a vector of "atomic"
> variables. What is the result you are looking for?

This is for YADE, our software for discrete modelling.

Imagine a std::vector of 125000 spheres:

https://yade-dem.org/wiki/Screenshots_and_videos#Ball_Mill_-_125_000_spheres

it is currently parallelized with OPEN MP, but there are some global
locks in few places. Saying that each sphere is atomic (instead of
locking whole container) would solve the problem.

best regards

-- 
Janek Kozicki                               http://janek.kozicki.pl/  |

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