Engine execution question

6 views
Skip to first unread message

Visser, Dale

unread,
Jun 22, 2015, 5:50:32 PM6/22/15
to dependen...@googlegroups.com
I am writing an analyzer, and I have written a piece of code like this, where 'dependency' is a new Dependency instance I have created inside the Analyzer, and 'engine' is the Engine instance passed into analyzeFileType(Dependency, Engine):

// copy, alter and set in case some other thread is iterating over
final List<Dependency> dependencies = new ArrayList<Dependency>(engine.getDependencies());
dependencies.add(dependency);
engine.setDependencies(dependencies);

Am I being too cautious? Is the execution of the various Analyzers by the Engine single-threaded, or effectively so?

Best regards,
Dale Visser

Jeremy Long

unread,
Jun 23, 2015, 5:57:43 AM6/23/15
to Visser, Dale, dependen...@googlegroups.com
Due to how some of the analyzers work they will only be executed in a single-threaded order. Some of the analyzers may spin up threads to do their individual work faster, but individual analyzers will not execute at the same time as other analyzers. So yes, the code is a little too cautious.

--Jeremy


--
You received this message because you are subscribed to the Google Groups "Dependency Check" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dependency-che...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages