mentby.com
Blog | Jobs | Help | Signup | Login

loading

Boost Atomic ?

Wed, 29 Jun 2011 13:16:31 -0700 Post Comments

I'm happily using c++0x atomics with g++ and libstdc++ 4.6.0 and haven't
found any missing bits yet.

- Marsh
One trick I've used is to define a custom color map that always returns
'black' for every node that you don't want the BFS algorithm visiting.
The current BFS implementation still visits the first node though, but
that wasn't a problem.

After you find your node, you could flip a switch in your custom color
map so that it then always returns black. You could also empty the
Buffer Q explicitly. Some combination of those should exit the algorithm
fairly quickly.

It also means you don't have to allocate map storage for every node in
the graph, just for the ones actually visited. You'd use
breadth_first_visit since your color map can perform its own initialization.

I'm a BGL newb though, so perhaps someone else has a better way.

- Marsh
Perhaps that address space was already being used by something. This is
likely to be the case with large regions on a 32-bit OS.

How large is is the segment you're trying to map?

Is your process running as 64- or 32-bits?

What happens if something else is already at that address?

- Marsh

Read more »

Profile Widget
Copy and paste this HTML code to your blog or website: