本文整理汇总了C#中Process.AddIoBurst方法的典型用法代码示例。如果您正苦于以下问题:C# Process.AddIoBurst方法的具体用法?C# Process.AddIoBurst怎么用?C# Process.AddIoBurst使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Process
的用法示例。
在下文中一共展示了Process.AddIoBurst方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Main
static void Main(string[] args)
{
var _this = new Controller();
if (args.Length != 2)
{
Console.WriteLine("Program requires arguments consisting of a config file " +
"with initialization values and a time quantum value.");
Console.WriteLine("Usage: JobSchedSimulator.exe [input file] [quantum number]");
Environment.Exit(1);
}
try
{
StreamReader fileReader;
String line;
_this.time_quantum = int.Parse(args[1]);
fileReader = File.OpenText(args[0]);
line = fileReader.ReadLine();
string[] input_values;
Process temp;
int i;
int process_id = 1;
while (line != null)
{
input_values = line.Split(new string[1] { " " }, StringSplitOptions.RemoveEmptyEntries);
temp = new Process();
temp.process_id = process_id;
temp.arrival_time = int.Parse(input_values[0]);
temp.num_cpu_bursts = int.Parse(input_values[1]);
for (i = 2; i < input_values.Length; i++)
{
if (i % 2 == 0)
temp.AddCpuBurst(int.Parse(input_values[i]));
else
temp.AddIoBurst(int.Parse(input_values[i]));
}
_this.process_List.Add(temp);
process_id++;
line = fileReader.ReadLine();
}
fileReader.Close();
}
catch (IOException e)
{
Console.WriteLine("Could Not Open file");
Console.WriteLine(e.Message);
Environment.Exit(1);
}
catch (Exception e)
{
Console.WriteLine("Malformed input");
Console.WriteLine(e.Message);
Environment.Exit(1);
}
_this.Populate_Event_List();
_this.gui = new DisplayForm(_this);
Application.Run(_this.gui);
}