File: THOUGHTS

package info (click to toggle)
rlinetd 0.9.1-3
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 2,896 kB
  • sloc: sh: 5,175; ansic: 3,212; yacc: 1,585; makefile: 169; lex: 131; sed: 16; perl: 4
file content (19 lines) | stat: -rw-r--r-- 828 bytes parent folder | download | duplicates (12)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
-*- text -*-
o a service limited to a single instance but with multiple incoming
sockets. the pure approach is to block all sockets once the limit is
exceeded. this is silly - if you have a udp client listening on n
sockets, then you can have n instances, each hogging a single
socket. this is tres cool, and makes the fd code in engine.c and
signals.c much simpler. the downside is that then the meaning of
'instances' changes from 'the number of instances that run
simultaneously' to something weird, that is better expressed as 'the
number of instances that can run simultaneously is instances + the
number of sockets, if more than one'. blah.


  How about a semaphore with a limit of 1?

  sem->match = { OP_REMOVEMYFDFROMLISTENLIST, OP_DOWN, me };
  sem->under = NULL;

  pidtab->onexit = { OP_ADDMYFDBACKINTOLISTENLIST };