我在下面使用以下代码来处理.我在这里遇到的问题是代码在while循环中运行而不等待String temp = Console.ReadLine()行的输入.需要帮助了解为什么以及如何修复请.提前致谢!
/*Banker's algorithm Implementation*/
class Program
{
static void Main(string[] args)
{
int n = 0;//number of resources we will be dealing with
int proc_num = 0;//Total number of processes to share available resources
IDictionary<String, SysProcess> processes = new Dictionary<String, SysProcess>();
IDictionary<String, int> MaxR = new Dictionary<String, int>();// maximum available resources
IDictionary<String, int> avail = new Dictionary<String, int>();// Available resources after first allocation
Dictionary<String, int> availsum = new Dictionary<string, int>();
//Start
while (true)
{
Console.WriteLine(" …Run Code Online (Sandbox Code Playgroud)