New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

concurrency #86

Closed
jschoch opened this Issue Oct 8, 2016 · 0 comments

Comments

Projects
None yet
2 participants
@jschoch

jschoch commented Oct 8, 2016

I'm doing a few experiments and keep running into ConcurrentModificatio
nException. What strikes me as odd is that access such as g.v(...).first causes problems.

I'm using tinkergraph, perhaps that is causing it's own problems that may be solved with a non-memory backend?

What' i'd like to do is parse a CSV file into a graph. Some items need to be looked up first. create_vertex seems to work fine with Thread or the Parallel gem. routes do not, and add_edges_to also seems problematic. I've experimented with bulk_job, but this seems very slow for a single vertex result.

basic example

(1..1000).each do |n|
      Thread.new {
        new_node = g.create_vertex({thing: n})
        name = Random.rand(1000)

        #  Blows up
        #v = g.v(name: name).first

       # works
        v = g.vertex(name)
        if v == nil
          raise "bad! #{name}"
        end
        v.add_edges_to(:unf, new_node)
      }
    end

in this test I can grab the vertex by the raw ID, in my project I have another key and do not use it for the vertex id. should I keep some index of the key mappings for the pacer id's to my id's to avoid creating a "route"? Why does reading a route create an exception? Is tinkergraph and the lack of transactions the problem?

any help appreciated.

@pangloss pangloss closed this Mar 24, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment