Ejemplo n.º 1
0
        public void dbgDisplayIndex(IHasher hasher, Scheduler dbgScheduler)
        {
            List <WaitRecord> waitRecords = new List <WaitRecord>(waitingVerbs.Values);

            for (int i = 0; i < waitRecords.Count(); i++)
            {
                WaitRecord         wr              = waitRecords[i];
                List <int>         depNums         = new List <int>();
                List <BuildObject> unknownDeps     = new List <BuildObject>();
                List <string>      unscheduledDeps = new List <string>();
                foreach (BuildObject dep in wr.knownDeps)
                {
                    IVerb depOnVerb = hasher.getParent(dep);
                    if (depOnVerb == null)
                    {
                        unknownDeps.Add(dep);
                    }
                    else if (!waitingVerbs.ContainsKey(depOnVerb))
                    {
                        unscheduledDeps.Add(String.Format("{0} waiting on {1} {2}",
                                                          dep, depOnVerb,
                                                          dbgScheduler.dbgGetVerbStatus(depOnVerb)));
                    }
                    else
                    {
                        WaitRecord depWr = waitingVerbs[depOnVerb];
                        depNums.Add(waitRecords.IndexOf(depWr));
                    }
                }
                Logger.WriteLine(String.Format("{0}. {1} waits on ({2}), {3} unknown, {4} unscheduled",
                                               i, wr.verb, String.Join(",", depNums), unknownDeps.Count(), unscheduledDeps.Count()));
                dbgPreview("Unknown", unknownDeps.Select(it => it.ToString()), 3);
                dbgPreview("Unscheduled", unscheduledDeps, 20);
            }
        }
Ejemplo n.º 2
0
        internal void insert(IVerb verb, IEnumerable <BuildObject> knownDeps)
        {
            //- insert one fwd pointer for each obj verb is already known to
            //- depend upon. The fact that this verb is waiting implies that
            //- one of these deps is stale here and needs built/fetched.
            WaitRecord waitRecord = new WaitRecord(verb, knownDeps);

            foreach (BuildObject dep in knownDeps)
            {
                if (!fwdDeps.ContainsKey(dep))
                {
                    fwdDeps.Add(dep, new HashSet <WaitRecord>());
                }
                fwdDeps[dep].Add(waitRecord);
            }
            waitingVerbs.Add(verb, waitRecord);
            Say("sleeps " + verb);
        }
Ejemplo n.º 3
0
        internal void insert(IVerb verb, IEnumerable<BuildObject> knownDeps)
        {
            // Insert one fwd pointer for each obj verb is already known to
            // depend upon. The fact that this verb is waiting implies that
            // one of these deps is stale here and needs built/fetched.
            WaitRecord waitRecord = new WaitRecord(verb, knownDeps);
            foreach (BuildObject dep in knownDeps)
            {
                if (!this.fwdDeps.ContainsKey(dep))
                {
                    this.fwdDeps.Add(dep, new HashSet<WaitRecord>());
                }

                this.fwdDeps[dep].Add(waitRecord);
            }

            this.waitingVerbs.Add(verb, waitRecord);
            this.Say("sleeps " + verb);
        }