Ongoing/Thread (3) 썸네일형 리스트형 Thread [Java] implements Runnable // [Java] Thread Samplepackage package1; public class Program { public static void main(String[] args) { Thread t1 = new Thread(new A()); Thread t2 = new Thread(new B()); t1.start(); t2.start(); for (int i = 0; i < 10000; i++) { System.out.print("@"); } }} class A implements Runnable { public void run() { for (int i = 0; i < 10000; i++) { System.out.print("."); } }} class B implements Runnable {.. Thread [C#] C# 2.0 Style Thread without ThreadStart // C# 2.0 Style Threadusing System;using System.Threading; namespace ThreadSample{ class Program { static void Main(string[] args) { // C# 2.0 Style Thread does not use ThreadStart Thread t2 = new Thread(Work); t2.Start(); for (int count = 0; count < Repetitions; count++) { Console.Write('@'); } } static void Work() { for (int count = 0; count < Repetitions; count++) { Console.Write('.'); } } co.. Thread [C#] C# 1.0 Style Thread with ThreadStart // C# 1.0 Style Threadusing System;using System.Threading; namespace ThreadSample{ class Program { static void Main(string[] args) { // C# 1.0 Style Thread uses ThreadStart ThreadStart ts = new ThreadStart(Work); Thread t1 = new Thread(ts); t1.Start(); for (int count = 0; count < Repetitions; count++) { Console.Write('@'); } } static void Work() { for (int count = 0; count < Repetitions; count++.. 이전 1 다음