I need to iterate over the vertices and edges of a BGL adjacency_list from several threads. Which would be an efficient way to d开发者_JS百科o that, provided that the graph is large (mutex..)?
The BGL methods don't support reentrant calls?
BGL is currently not thread safe. Take a look at MTGL which provides a BGL like interface but is designed for massively multithreaded platforms.
As long as you aren't modifying the graph structure, multiple concurrent reads are safe; updates and writes to properties require locking. The page that was linked is about algorithms running in parallel, which they currently don't in plain BGL.
精彩评论