Merge branch 'master' of git://github.com/thepowersgang/acess2
[tpg/acess2.git] / Notes / VFS - Select.txt
1 select()
2 - Implemented using a wait queue for every file descriptor
3 - That requires waiting on sockets to be centeralised
4
5 All wait tasks (reads on VTerm, Pipes, PTYs, network sockets) use the kernel
6 version of select with an inifinite timeout.
7 They then signal the VFS using their VFS node pointer as a reference
8
9 The VFS function select()
10 - Maintains a list of processes on each node (if select has been called on that node)
11 - Each process maybe has a semaphore on it (to use the semaphore code to maintain the process list)
12  > Could maybe use a mutex instead
13
14
15 VFS_Select(int, fd_set* read, fd_set* write, fd_set* except)
16
17 read is the set of sockets that we are waiting to read from
18 write         "           "           "           be able to write to
19 except        "           "           "        for possible errors on
20
21
22 Hence, each VFS_Node has three listener lists (or just pointers)
23 - One for when data is avaliable
24 - One for when space is avaliable for writing
25 - One for when an error occurs (closed pipe, etc ...)

UCC git Repository :: git.ucc.asn.au