blob: 6890c96d9b10a083086b4ddec9b945f23788ae38 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
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
|