Esempio n. 1
0
 private void timer_Tick(object sender, EventArgs e)
 {
     //se tiver espaço na memoria para o primeiro processo da memoria virtual
     if (!VirtualMemory.Empyt())
     {
         if (!Memory.MemoryFull(VirtualMemory.FirstLenght()))
         {
             Memory.InitializeProcess(VirtualMemory.KillProcess());
         }
     }
 }
Esempio n. 2
0
 public static void InitializeProcess(Process MyProcess)
 {
     if (MyProcess.Size + Length <= Capacity)
     {
         Length += MyProcess.Size;
         cont++;
         Ram.Enqueue(MyProcess);
     }
     else
     {
         VirtualMemory.InitializeProcess(MyProcess);
     }
 }
Esempio n. 3
0
        private void Button13_Click(object sender, EventArgs e)
        {
            Process p = new Process();

            p.Name = "Photoshop";
            p.Size = 40;
            p.Time = 15;

            if (Memory.MemoryFull(p.Size))
            {
                VirtualMemory.InitializeProcess(p);
            }
            else
            {
                Memory.InitializeProcess(p);
            }

            RefreshData();
        }
Esempio n. 4
0
        private void Button11_Click(object sender, EventArgs e)
        {
            Process p = new Process();

            p.Name = "Bloco de Notas";
            p.Size = 8;
            p.Time = 4;

            if (Memory.MemoryFull(p.Size))
            {
                VirtualMemory.InitializeProcess(p);
            }
            else
            {
                Memory.InitializeProcess(p);
            }

            RefreshData();
        }
Esempio n. 5
0
        private void button6_Click(object sender, EventArgs e)
        {
            Process p = new Process();

            p.Name = "Power Point";
            p.Size = 16;
            p.Time = 6;

            if (Memory.MemoryFull(p.Size))
            {
                VirtualMemory.InitializeProcess(p);
            }
            else
            {
                Memory.InitializeProcess(p);
            }

            RefreshData();
        }
Esempio n. 6
0
        private void button5_Click(object sender, EventArgs e)
        {
            Process p = new Process();

            p.Name = "Excel";
            p.Size = 10;
            p.Time = 4;

            if (Memory.MemoryFull(p.Size))
            {
                VirtualMemory.InitializeProcess(p);
            }
            else
            {
                Memory.InitializeProcess(p);
            }

            RefreshData();
        }
Esempio n. 7
0
        private void button4_Click(object sender, EventArgs e)
        {
            Process p = new Process();

            p.Name = "Visual Studio";
            p.Size = 50;
            p.Time = 20;

            if (Memory.MemoryFull(p.Size))
            {
                VirtualMemory.InitializeProcess(p);
            }
            else
            {
                Memory.InitializeProcess(p);
            }

            RefreshData();
        }