bgaff commented on issue #7656:
URL: https://github.com/apache/trafficserver/issues/7656#issuecomment-811143735


   Sorry my bad the autoconf script always defines TS_USE_EPOLL, you need to do:
   
   The easiest fix is:
   ```
   sed -Ei 's/#ifdef HAVE_EVENTFD/#if defined(HAVE_EVENTFD) \&\& TS_USE_EPOLL 
== 1' src/tscore/EventNotify.cc
   ```
   
   That should fix it, but that whole class is kinda ridiculous anyway. Using 
eventfd + epoll in this way is overkill, the ink_condwait methods should be 
preferred for many reasons as they solve the same problem:
     1. ink_condwait and friends will wrap into pthread_cond_(timed)wait which 
are as the name implies posix compliant.
     2. When using pthread_cond_wait In the case of a signal before a wait no 
syscall is ever required on most platforms, ie. linux uses futex(2) on 
contention but it will check the state in userspace before making a syscall.
     3. Using eventfd(2) in this way doesn't make sense as you're never 
acutally using the FD with anything other than this epoll fd.
     4. Even if you choose to use eventfd(2) in this way it should probably use 
poll(2) as it's posix compliant, whereas epoll is linux specific.
   
   Eventfds make sense in situations where you have an existing pollfd / 
epollfd / etc where you want to tack on some event notification, when you're 
creating an eventfd to use only with poll/epoll/etc there usually is a better 
way.
   
   My suggestion is: just yank out all of this eventfd / epoll code and make it 
use ink_cond_wait/ink_cond_timedwait and be done with it.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to