using System;
using [Link];
namespace MultithreadingDemo01Kcmt
{
class Abc
{
public void Show()
{
for (char alph = 'a'; alph != 'z'; alph++)
{
[Link](alph+"\t"+[Link]);
[Link](200);
}
}
public void Display()
{
for (int i = 0; i <= 26; i++)
{
[Link](i + "\t" + [Link]);
[Link](200);
}
}
}
class Program
{
static void Main()
{
Abc obj1 = new Abc();
//1.0
//[Link]();
//[Link]();
//1.1
Thread t1 = new Thread([Link]);
[Link] = "First User defined thread";
Thread t2 = new Thread([Link]);
[Link] = "Second user defined thread";
[Link]();
[Link]();
[Link]();
}
}
}
+++++++++++++++++++++++++++++++++++++++++++++
using System;
using [Link];
namespace MultithreadingDemo01Kcmt
{
class Abc
{
public void Show()
{
//lock (this)
//{
// for (char alph = 'a'; alph != 'z'; alph++)
// {
// [Link](alph + "\t" + [Link]);
// [Link](200);
// }
//}
//or
[Link](this);
for (char alph = 'a'; alph != 'z'; alph++)
{
[Link](alph + "\t" + [Link]);
[Link](200);
}
[Link](this);
}
class Program
{
static void Main()
{
Abc obj1 = new Abc();
Thread t1 = new Thread([Link]);
[Link] = "First User defined thread";
Thread t2 = new Thread([Link]);
[Link] = "Second user defined thread";
[Link]();
[Link]();
[Link]();
}
}
}