Skip to content
Snippets Groups Projects
  • Andy Green's avatar
    d78c9325
    cgi: stdout POLLHUP holy grail · d78c9325
    Andy Green authored
    This a) directly discovers cgi stdout POLLUP and b) modulates rx flow control on CGI STDOUT
    according to the outgoing writeable service.  When the outgoing writeable service finally sees
    0 read() waiting for it even though it was signalled for POLLIN, it knows it is a POLLHUP.
    
    Critically when it sees POLLHUP like that, it leaves the rx flow control defeating any
    further stdout POLLIN signalling while the rest of the CGI lifecycle completes, eliminating
    busywaiting during the CGI.
    d78c9325
    History
    cgi: stdout POLLHUP holy grail
    Andy Green authored
    This a) directly discovers cgi stdout POLLUP and b) modulates rx flow control on CGI STDOUT
    according to the outgoing writeable service.  When the outgoing writeable service finally sees
    0 read() waiting for it even though it was signalled for POLLIN, it knows it is a POLLHUP.
    
    Critically when it sees POLLHUP like that, it leaves the rx flow control defeating any
    further stdout POLLIN signalling while the rest of the CGI lifecycle completes, eliminating
    busywaiting during the CGI.