Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 8e09b38534f32e03d32422ea316b0b9305784465
Ticket: 3541646fffffffffffffffffffffffffffffffff
Don't panic on triggerPipe overrun
User & Date: ferrieux on 2012-07-11 05:32:45
Changes

  1. icomment:
    No, the notifier is not losing wake-ups when the pipe is full !
    
    The purpose of the \0 send over the triggerPipe is to kick the notifier out of the current select(), recompute the select masks according to the new state of all fileevents in all threads, and back to blocking select() with the new state.
    Hence, a single \0 can serve many updates. When the pipe is full of 4096 wake-ups, the 4097th is a waste anyway.
    
    As mentioned earlier, only the 'q' is problematic. My suggestion for this is to replace the 'q' with simply setting a global flag pleaseNotifierDie, and sending a regular \0 over the pipe, with the same waking effect. The flag, checked in the loop at the same place where the 'q' is sought, would break out of the loop and terminate the notifier. In the context of the original poster, this would even yield a faster exit since this would bypass the 4096 enqueued (useless) updates.
    
    Comments ?
    
    
  2. login: "ferrieux"
  3. mimetype: "text/plain"
  4. username: "ferrieux"