Exemple #1
0
 public Board64_Test() : base()
 {
     registry = new Board64<string>();
     DefaultTraceListener Logfile = new DefaultTraceListener();
     Logfile.Name = "Logfile";
     Trace.Listeners.Add(Logfile);
     Logfile.LogFileName = $"Board64_{DateTime.Now.ToFileTime().ToString()}_Test.log";
 }
Exemple #2
0
        /// <summary>
        /// The board64_MultiThread_Test.
        /// </summary>
        /// <param name="collection">The collection<see cref="IList{KeyValuePair{object, string}}"/>.</param>
        /// <returns>The <see cref="Task"/>.</returns>
        private Task board64_MultiThread_Test(IList <KeyValuePair <object, string> > collection)
        {
            registry = new Board64 <string>();
            Action publicTest = () =>
            {
                int c = 0;
                lock (holder)
                    c = threadCount++;

                SharedDeck_ThreadIntegrated_Test(collection.Skip(c * 10000).Take(10000).ToArray());
            };

            for (int i = 0; i < 6; i++)
            {
                s1[i] = Task.Factory.StartNew(publicTest);
            }

            return(Task.Factory.ContinueWhenAll(s1, new Action <Task[]>(a => { publicBoard_MultiThread_TCallback_Test(a); })));
        }