Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Threading;
- namespace Threading
- {
- class MainClass
- {
- public static int ida=0;
- public static void Main (string[] args)
- {
- for(int a=1;a<=Environment.ProcessorCount;a++){
- Console.WriteLine("Thread ID: "+a+" Started.");
- Thread thrd = new Thread (Test);
- thrd.Start();
- }
- //Console.WriteLine("DONE!");
- Console.ReadKey();
- }
- public static void Test(){
- ida++;
- double a=new double();
- for(int i=0;i<100000;i++){
- a=Math.PI*i;
- }
- Console.WriteLine("DONE! "+ida);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement