04 Task Performance 1 - ARG - Reyes, Abraham
04 Task Performance 1 - ARG - Reyes, Abraham
CLICK RUN:
CODE :
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace ThreadTP
[DllImport("kernel32.dll")]
Thread threadA;
Thread threadB;
Thread threadC;
Thread threadD;
public Form1()
InitializeComponent();
class MyThreadClass
Thread.Sleep(500);
Thread.Sleep(1500);
Thread.Sleep(1500);
}
Thread.Sleep(1500);
if (i == 5)
IsThread = true;
AllocConsole();
{
threadA = new Thread(MyThreadClass.thread1);
threadA.Priority = ThreadPriority.Highest;
threadB.Priority = ThreadPriority.Normal;
threadC.Priority = ThreadPriority.AboveNormal;
threadD.Priority = ThreadPriority.BelowNormal;
// Start threads
threadA.Start();
threadC.Start();
threadD.Start();
threadB.Start();
threadC.Join();
threadB.Join();
threadD.Join();
if (IsThread)