Refactor process lifecycle to use Start, Tick, Stop methods and metrics

This commit is contained in:
Stone_Red
2026-06-10 02:28:57 +02:00
parent 31e54c1637
commit b3c98b1b1d
7 changed files with 163 additions and 81 deletions
+6 -8
View File
@@ -34,8 +34,6 @@ public class Kernel : Sys.Kernel
Sys.Mouse.MouseManager.Initialize();
Sys.Keyboard.KeyboardManager.Initialize();
_ = ProcessManager.SpawnProcess<CliProcess>();
}
protected override void Run()
@@ -57,13 +55,13 @@ public class Kernel : Sys.Kernel
}
}
Thread.Sleep(1000);
ProcessManager.TickAllProcesses();
}
}
public class TestProcess() : Process("Test Process")
{
internal override void Run(string[] args)
internal override void Start(string[] args)
{
Window window = WindowManager.CreateWindow(this, "Test Window", Point.Empty, new Size(200, 150));
window.AutoFlush = true;
@@ -78,11 +76,11 @@ public class TestProcess() : Process("Test Process")
circle.Radius = 40;
SendMessageToAllProcesses(new TestMessage { SenderProcessId = Id });
}
while (!StopRequested)
{
Thread.Sleep(1000);
}
internal override void Tick()
{
// Example tick logic - could be used for animations, timed events, etc.
}
internal override void HandleInterProcessMessage(Message message)