From 58d2f56cd5211d93b4984e1f66a8aba5f0599942 Mon Sep 17 00:00:00 2001 From: John Hodge Date: Sun, 27 Feb 2011 19:13:27 +0800 Subject: [PATCH] Notes on how to implement select() --- Design Notes/VFS - Select.txt | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 Design Notes/VFS - Select.txt diff --git a/Design Notes/VFS - Select.txt b/Design Notes/VFS - Select.txt new file mode 100644 index 00000000..cceef5ce --- /dev/null +++ b/Design Notes/VFS - Select.txt @@ -0,0 +1,12 @@ +select() +- Implemented using a wait queue for every file descriptor +- That requires waiting on sockets to be centeralised + +All wait tasks (reads on VTerm, Pipes, PTYs, network sockets) use the kernel +version of select with an inifinite timeout. +They then signal the VFS using their VFS node pointer as a reference + +The VFS function select() +- Maintains a list of processes on each node (if select has been called on that node) +- Each process maybe has a semaphore on it (to use the semaphore code to maintain the process list) + > Could maybe use a mutex instead -- 2.20.1