Esempio n. 1
0
        /// <summary>
        ///     Load a graph with root node at entryProjectFile
        ///     Maintain a queue of projects to be processed and evaluate projects in parallel
        ///     Returns false if loading the graph is not successful
        /// </summary>
        private Dictionary <ConfigurationMetadata, ProjectGraphNode> FindGraphNodes()
        {
            foreach (ConfigurationMetadata projectToEvaluate in _entryPointConfigurationMetadata)
            {
                ParseProject(projectToEvaluate);
            }

            _graphWorkSet.WaitForAllWork();
            _graphWorkSet.Complete();
            _graphWorkSet.WaitForCompletion();

            return(_graphWorkSet.CompletedWork);
        }
Esempio n. 2
0
        /// <summary>
        ///     Load a graph with root node at entryProjectFile
        ///     Maintain a queue of projects to be processed and evaluate projects in parallel
        ///     Returns false if loading the graph is not successful
        /// </summary>
        private Dictionary <ConfigurationMetadata, ParsedProject> FindGraphNodes()
        {
            foreach (ConfigurationMetadata projectToEvaluate in _entryPointConfigurationMetadata)
            {
                SubmitProjectForParsing(projectToEvaluate);

                /*todo: fix the following double check-then-act concurrency bug: one thread can pass the two checks, loose context,
                 * meanwhile another thread passes the same checks with the same data and inserts its reference. The initial thread regains context
                 * and duplicates the information, leading to wasted work
                 */
            }

            _graphWorkSet.WaitForAllWork();
            _graphWorkSet.Complete();
            _graphWorkSet.WaitForCompletion();

            return(_graphWorkSet.CompletedWork);
        }