コード例 #1
0
ファイル: Program.cs プロジェクト: wp-source/manageInterOpp
        static void OneCallTest_TestManagedWorker()
        {
            Console.WriteLine("One call - Managed worker (P/Invoke) test:");

            using (ManagedWorker worker = new ManagedWorker())
            {
                Console.Write("Starting...");

                worker.Start();

                worker.QueueDemoWorkerTasks();

                worker.Stop();

                Console.WriteLine(" - Finished.");

                worker.PrintStatistics();

                _managedWorkerWorkingSeconds.Add(worker.GetWorkingSeconds());
            }
        }
コード例 #2
0
ファイル: Program.cs プロジェクト: wp-source/manageInterOpp
        static void MultipleSyncCallsTest_TestManagedWorker()
        {
            Console.WriteLine("Synchronous calls - Managed worker (P/Invoke) test:");

            using (ManagedWorker worker = new ManagedWorker())
            {
                Console.Write("Starting...");

                worker.Start();

                Parallel.ForEach(_tasksLoopCounts, t => { worker.ExecuteWorkerTask(t, t); });

                worker.Stop();

                Console.WriteLine(" - Finished.");

                worker.PrintStatistics();

                _managedWorkerWorkingSeconds.Add(worker.GetWorkingSeconds());
            }
        }
コード例 #3
0
ファイル: Program.cs プロジェクト: wp-source/manageInterOpp
        static void MultipleCallsTest_TestManagedWorker()
        {
            Console.WriteLine("Multiple calls - Managed worker (P/Invoke) test:");

            using (ManagedWorker worker = new ManagedWorker())
            {
                Console.Write("Starting...");

                worker.Start();

                foreach (uint taskLoopCount in _tasksLoopCounts)
                {
                    worker.QueueWorkerTask(taskLoopCount, taskLoopCount);
                }

                worker.Stop();

                Console.WriteLine(" - Finished.");

                worker.PrintStatistics();

                _managedWorkerWorkingSeconds.Add(worker.GetWorkingSeconds());
            }
        }