コード例 #1
0
 static void Main(string[] args)
 {
     //CreateThread.CreateThreadLambda();
     //PassingDataToAThread.PassParamsToThread(12133);
     //PassingDataToAThread.PassParamsToLambdaThread(11111);
     //AbortAThread.AbortThread();
     //AbortAThread.AbortThreadWithSharedFlagVariable();
     //ThreadSyncronizationJoin.ThreadSyncJoin();
     //ThreadLocal.RunThreadLocalExample();
     //ThreadContextInfo.DisplayThreadContext();
     ThreadPoolExample.ThreadPoolStuff();
 }
コード例 #2
0
ファイル: Program.cs プロジェクト: Ryabik/CSharpProfessional
        static void Main(string[] args)
        {
            var exampleToRun = ExamplesEnumeration.ThreadPool;

            switch (exampleToRun)
            {
            case ExamplesEnumeration.SecondThread:
                SecondThreadExample.ShowSecondThread();
                break;

            case ExamplesEnumeration.Join:
                JoinExamples.ShowJoin();
                break;

            case ExamplesEnumeration.JoinFromSecondaryThread:
                JoinExamples.ShowJoinFromSecondaryThread();
                break;

            case ExamplesEnumeration.GlobalVariable:
                GlobalVariableExample.ShowGlobalVariable();
                break;

            case ExamplesEnumeration.Abort:
                AbortExample.ShowAbort();
                break;

            case ExamplesEnumeration.Monitor:
                MonitorExample.ShowMonitor();
                break;

            case ExamplesEnumeration.Interlocked:
                InterlockedExample.ShowLock();
                break;

            case ExamplesEnumeration.ThreadPool:
                ThreadPoolExample.ShowThreadPool();
                break;
            }

            Console.Read();
        }