Boost logo

Boost Users :

Subject: Re: [Boost-users] BGL and threaded graph modification
From: Andrew Sutton (andrew.n.sutton_at_[hidden])
Date: 2009-07-29 08:17:05


>
> I am wondering if it is possible to modify a single graph object by
> multiple threads which attach edges into seperated regions of the graph? To
> be exact: I have a set of vertices in my graph with index 0-maxIndex which I
> want to copy a couple of times into that same graph structure one after
> another. Of course, I assure that there are no resize events during copying
> and no overlapping. This should be possible, I think, at least in theory,
> but I found no word about that in the docs of the BGL. So, should it work or
> not?
>

It depends on your choice of graph data structure. If you're using an
adjacency_matrix, then trivially yes. If you're using adjacency_list, then
you may have problems. The adjacency_list contains a global list of edges
that is modified on add_edge so you're probably going to run into race
conditions.

Andrew Sutton
andrew.n.sutton_at_[hidden]



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net