Updates the internal representation of signals in NotificationQueue
Summary: The signals were represented using bytes in a pipe or using a count on an event fd (when available). This count was ever growing and caused the pipe to overflow, and in both cases you would get signals on empty queues. This diff only writes to the fd if it there are no bytes to read. Due to races there can still be multiple bytes in the pipe, but overflowing should not be possible. Instead of blindly signaling when there could be messages in the queue, the signals are now synchronized with the state of the queue so that the signals are drained when the queue is empty. This also made it possible to skip the semaphore behavior of the event fd which should improve perf. Reviewed By: dcolascione Differential Revision: D3198252 fb-gh-sync-id: 39e620b10c254ffcacabc4c5ac36950a215d4803 fbshipit-source-id: 39e620b10c254ffcacabc4c5ac36950a215d4803
Showing
Please register or sign in to comment