From 9af5588c30c4126a2800aae1afcb0de2c373dc6c Mon Sep 17 00:00:00 2001 From: Benji Dial Date: Mon, 20 May 2024 17:40:47 -0400 Subject: rewrite application stuff in the kernel to support multitasking --- documentation/kernel/applications.txt | 41 +++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 documentation/kernel/applications.txt (limited to 'documentation/kernel/applications.txt') diff --git a/documentation/kernel/applications.txt b/documentation/kernel/applications.txt new file mode 100644 index 0000000..6890c96 --- /dev/null +++ b/documentation/kernel/applications.txt @@ -0,0 +1,41 @@ +globally there are: + an id-list of processes + an id-list of threads + a queue of paused threads + a single running thread + +a paused thread is a thread that can run, but isn't. +a thread that is not running and is not paused is in a blocking syscall. + +each process has: + a process id + a list of threads + a list of open file streams + a list of open socket stream ends + a list of running socket listeners + a list of environment variables (pairs of strings) + +a thread has: + an owning process + optionally: + a stream end it is waiting to read from + a socket listener it is waiting to accept a connection from + a socket listener it is waiting to connect to + if not running: + saved cpu state + +a socket has: + two queues + +an open socket stream end has: + a list of threads waiting to read from it + the socket + its input queue + its output queue + if the other side is open: + the other process + the other stream end + +a running socket listener has: + a list of threads waiting to accept a connection from it + a list of threads waiting to connect to it -- cgit v1.2.3