answersLogoWhite

0

This should get you started:

using System;

using System.Threading;

namespace Flurp

{

public class ThreadTest

{

private static readonly Random _Random = new Random();

private static void RunThread()

{

for ( int i = 0; i < 20; i++ )

{

string name = Thread.CurrentThread.Name;

Console.WriteLine( "{0}: {1}", name, i );

Thread.Sleep(_Random.Next(1000));

}

}

public static void Main()

{

Thread thread1 = new Thread( RunThread );

Thread thread2 = new Thread( RunThread );

thread1.Name = "Thread 1";

thread2.Name = "Thread 2";

thread1.Start();

thread2.Start();

}

}

}

User Avatar

Wiki User

∙ 13y ago
User Avatar

What else can I help you with?

Related Questions

What is the difference between windows programming and .Net programming?

Windows programming is a general term for writing programs intended for the Windows platforms. We can write Windows programs in any programming language. The .NET framework is specifically intended to be used with C#, F# and Visual Basic programming languages.


.net is the programming language?

No. .NET is a framework, not a programming language. It is the common framework used by the C#, F# and Visual Basic programming languages.


Is NET programming is update from C plus plus programming?

No. .NET programming is Microsoft-specific, similar to Java in some respects, but it is non-portable. C++ is a general purpose and cross-platform programming language.


What are the differences between PHP and .NET?

.NET is a framework, PHP is a scripting (programming) language.


Is vbnet a programming language?

Yes, VB.net is a programming language that utilizes the Microsoft .Net framework


What is CSharp?

The C# sharp programming language is a relatively young programming language created by Microsoft. It is heavily influenced by another (and older) programming language called C++, which in itself is often regarded as a succesor to the programming language C. As far to my knowledge C# is only used in order to develop .NET based applications.


How is event driven programming different from other programming?

write a note on event driven programming


What provides a large programming library for the NET languages?

The .NET Framework, as that is it's purpose. It IS the library for the .NET languages... hence the name.


In .NET is CLR a process or a thread?

Process .... it is responsible for managing the execution of the .NET programs , it is the same as JVM is for JAVA programs...


What Are The Options For Parallel Programming?

OpenMPCilk++PThreads or thread library built into languagesOpenCLCUDABrook+MPIPVMCharm++uC++


In what sense is java program similar to SharpDevelop program?

These two things are nothing alike. Java is a programming language. SharpDevelop is an integrated development environment (IDE) for the .NET platform, which is basically a nice graphical interface in which people can write programs in the .NET languages.


How programming language is useful in system programming?

Without programming languages you couldn't write (system) programs.