~ubuntu-branches/ubuntu/trusty/charybdis/trusty-proposed

« back to all changes in this revision

Viewing changes to doc/technical/fd-management.txt

  • Committer: Package Import Robot
  • Author(s): Antoine Beaupré
  • Date: 2011-11-10 23:07:37 UTC
  • Revision ID: package-import@ubuntu.com-20111110230737-kqo6qsglp5oh02hr
Tags: upstream-3.3.0
Import upstream version 3.3.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
Overview of the filedescriptor subsystem
 
2
Adrian Chadd <adrian@creative.net.au>
 
3
 
 
4
$Id: fd-management.txt 6 2005-09-10 01:02:21Z nenolod $
 
5
 
 
6
 
 
7
Filedescriptor lists
 
8
--------------------
 
9
 
 
10
The filedescriptor list is managed through the routines in fdlist.c .
 
11
These include:
 
12
 
 
13
fd_open() - tag an FD as "open" and active
 
14
fd_close() - tag an FD as "closed" and close() the filedescriptor
 
15
fd_note() - update the filedescriptor tag
 
16
 
 
17
You can get the current list of open filedescriptors through /stats F as
 
18
an oper.
 
19
 
 
20
 
 
21
 
 
22
FD lists
 
23
--------
 
24
 
 
25
The FD list support is very alpha. There are a few lists defined:
 
26
 
 
27
typedef enum fdlist_t {
 
28
    FDLIST_NONE,
 
29
    FDLIST_SERVICE,
 
30
    FDLIST_SERVER,
 
31
    FDLIST_IDLECLIENT,
 
32
    FDLIST_BUSYCLIENT,
 
33
    FDLIST_MAX
 
34
} fdlist_t;
 
35
 
 
36
FDLIST_NONE             Not on any list (ie close()d)
 
37
FDLIST_SERVICE          A service - listen() sockets, resolver, etc
 
38
FDLIST_SERVER           Server connections
 
39
FDLIST_IDLECLIENT       An idle client
 
40
FDLIST_BUSYCLIENT       A busy client
 
41
FDLIST_MAX              Used for bounds checking
 
42
 
 
43
The idea is that the SERVICE sockets need polling frequently, the SERVER
 
44
sockets also need polling frequently, BUSYCLIENT is for busy clients
 
45
which need frequent polling (eg we're trying to write to them), and
 
46
IDLECLIENT is for clients which we don't need to poll frequently.
 
47
THIS hasn't been decided upon yet.