diff options
author | Benji Dial <benji@benjidial.net> | 2024-05-20 17:40:47 -0400 |
---|---|---|
committer | Benji Dial <benji@benjidial.net> | 2024-05-20 17:40:47 -0400 |
commit | 9af5588c30c4126a2800aae1afcb0de2c373dc6c (patch) | |
tree | d2a48a97b1664f958b5f88a8b0c03ef8366b0f49 /documentation/kernel/applications.txt | |
parent | 5a54df93c4e9368c36e69d1e9c88cd2904e92308 (diff) | |
download | hilbert-os-9af5588c30c4126a2800aae1afcb0de2c373dc6c.tar.gz |
rewrite application stuff in the kernel to support multitasking
Diffstat (limited to 'documentation/kernel/applications.txt')
-rw-r--r-- | documentation/kernel/applications.txt | 41 |
1 files changed, 41 insertions, 0 deletions
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 |