From: Eric Wong <normalperson@yhbt.net>
To: Andreas Voellmy <andreas.voellmy@yale.edu>
Cc: viro@zeniv.linux.org.uk, linux-fsdevel@vger.kernel.org,
linux-kernel@vger.kernel.org,
"junchang.wang@yale.edu Wang" <junchang.wang@yale.edu>
Subject: Re: epoll with ONESHOT possibly fails to deliver events
Date: Thu, 20 Dec 2012 21:32:10 +0000 [thread overview]
Message-ID: <20121220213210.GA22655@dcvr.yhbt.net> (raw)
In-Reply-To: <9BE5F9A7-4D5B-4848-A0BA-55004240B6E0@yale.edu>
Andreas Voellmy <andreas.voellmy@yale.edu> wrote:
> I wrote a C program that behaves similar to my original program and
> triggers the bug. The bug only arises when I use enough cores and
> threads (about 16). The program is here:
> https://github.com/AndreasVoellmy/epollbug/blob/master/epollbug.c
I finally took a closer look at your code. I think your socketCheck()
thread is draining socket and causing the normal threads to miss
events.
Use the FIONREAD ioctl() instead to get unread bytes instead of recv().
If you want to recv() without draining the socket, you can also use
the MSG_PEEK flag.
next prev parent reply other threads:[~2012-12-20 21:32 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-12-11 22:23 epoll with ONESHOT possibly fails to deliver events Andreas Voellmy
2012-12-12 23:49 ` Andreas Voellmy
2012-12-13 9:32 ` Eric Wong
2012-12-13 15:29 ` Andreas Voellmy
2012-12-14 0:16 ` Andreas Voellmy
2012-12-14 0:16 ` Andreas Voellmy
2012-12-15 14:50 ` Andreas Voellmy
2012-12-15 14:50 ` Andreas Voellmy
2012-12-18 2:07 ` Eric Wong
2012-12-18 2:35 ` Andreas Voellmy
2012-12-18 17:27 ` Andreas Voellmy
2012-12-19 19:39 ` Andreas Voellmy
2012-12-20 21:32 ` Eric Wong [this message]
2012-12-20 22:25 ` Junchang(Jason) Wang
2012-12-21 15:32 ` Andreas Voellmy
2012-12-22 2:54 ` Eric Wong
2012-12-14 0:08 ` Phil Turmel
2012-12-14 0:15 ` Phil Turmel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20121220213210.GA22655@dcvr.yhbt.net \
--to=normalperson@yhbt.net \
--cc=andreas.voellmy@yale.edu \
--cc=junchang.wang@yale.edu \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=viro@zeniv.linux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.