Re: gnulib/poll.c license

2012-10-24 Thread Erik Faye-Lund
On Wed, Oct 24, 2012 at 11:18 PM, Thomas Martitz wrote: > Dear folks, > > I am on a mission to port Pulseaudio (PA) to Windows. PA relies heavily > on poll() and this is not properly implemented for Windows. I found your > poll() implementation and it works well (with some changes, which I > will

Re: [PATCH] rebase: report invalid commit correctly

2012-05-30 Thread Erik Faye-Lund
Sorry about this one, I guess the latest one-off patch I sent from this machine wasn't for git. Gnulib-folks, please ignore. Gitsters, a new one is coming ASAP. On Wed, May 30, 2012 at 6:36 PM, Erik Faye-Lund wrote: > In 9765b6a (rebase: align variable content, 2011-02-06), the code &g

[PATCH] rebase: report invalid commit correctly

2012-05-30 Thread Erik Faye-Lund
r out reference parsing, 2011-02-06) and merged in 78c6e0f (Merge branch 'mz/rebase', 2011-04-28). Correct this by reporting $onto_name istead. Reported-By: Manuela Hutter Signed-off-by: Erik Faye-Lund --- Here's a proper patch, I guess. On Wed, May 30, 2012 at 5:37 PM, Junio C H

Re: [PATCH] poll: prevent busy-waiting

2012-05-20 Thread Erik Faye-Lund
On Fri, May 18, 2012 at 9:40 AM, Paolo Bonzini wrote: > Il 16/05/2012 21:16, Erik Faye-Lund ha scritto: >> From: theoleblond >> >> SwitchToThread() only gives away the rest of the current time >> slice to another thread in the current process. So if the >> threa

[PATCH] poll: prevent busy-waiting

2012-05-16 Thread Erik Faye-Lund
From: theoleblond SwitchToThread() only gives away the rest of the current time slice to another thread in the current process. So if the thread that feeds the file decscriptor we're polling is not in the current process, we get busy-waiting. This can lead to very poor performance in some cases,

[PATCH] poll: do not return 0 on timeout=-1

2011-07-06 Thread Erik Faye-Lund
, 12 insertions(+), 0 deletions(-) diff --git a/ChangeLog b/ChangeLog index e56cd80..abd2640 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2011-07-06 Erik Faye-Lund + + poll: do not return 0 on timeout=-1 + * lib/poll.c: Loop with yield if no events occured + 2011-07-05 Jim

Re: lib/poll.c bug?

2011-07-06 Thread Erik Faye-Lund
On Thu, Jun 30, 2011 at 8:40 PM, Erik Faye-Lund wrote: > On Thu, Jun 30, 2011 at 7:51 PM, Eric Blake wrote: >> On 06/29/2011 11:31 AM, Erik Faye-Lund wrote: >>> POSIX says the following about poll "A value of 0 indicates that the >>> call timed out and no fil

Re: lib/poll.c bug?

2011-06-30 Thread Erik Faye-Lund
On Thu, Jun 30, 2011 at 7:51 PM, Eric Blake wrote: > On 06/29/2011 11:31 AM, Erik Faye-Lund wrote: >> POSIX says the following about poll "A value of 0 indicates that the >> call timed out and no file descriptors have been selected.". My >> interpretation is th

lib/poll.c bug?

2011-06-29 Thread Erik Faye-Lund
POSIX says the following about poll "A value of 0 indicates that the call timed out and no file descriptors have been selected.". My interpretation is that a return value of 0 would be illegal when timeout = -1. But when I call poll(..., -1), it seems 0 is returned under some conditions. Looking t

Re: lib/poll.c win32 deadlock

2010-08-25 Thread Erik Faye-Lund
On Wed, Aug 25, 2010 at 11:50 AM, Paolo Bonzini wrote: > On 08/25/2010 11:48 AM, Erik Faye-Lund wrote: >> >> Actually, when I think of it - if any pipe got POLLHUP already, >> shouldn't poll just return right away? I mean, we already have an >> event, waitin

Re: lib/poll.c win32 deadlock

2010-08-25 Thread Erik Faye-Lund
On Wed, Aug 25, 2010 at 9:24 AM, Paolo Bonzini wrote: > On 08/24/2010 10:58 PM, Erik Faye-Lund wrote: >> >> Hi, after debugging the Win32-emulation of poll a bit more I think >> I've found another problem with it. If all fds are pipes and have been >> hange

lib/poll.c win32 deadlock

2010-08-24 Thread Erik Faye-Lund
Hi, after debugging the Win32-emulation of poll a bit more I think I've found another problem with it. If all fds are pipes and have been hanged up and the timeout is -1, poll() stalls infinitely at MsgWaitForMultipleObjects(). That's because there's really nothing for it to wait for, but MsgWaitFo

Re: [PATCH] poll, select: handle ERROR_BROKEN_PIPE.

2010-08-23 Thread Erik Faye-Lund
--- a/ChangeLog > +++ b/ChangeLog > @@ -1,3 +1,12 @@ > +2010-08-22  Paolo Bonzini   > +           Erik Faye-Lund > + > +       poll, select: handle ERROR_BROKEN_PIPE. > +       * lib/poll.c (win32_compute_revents): Return POLLHUP when > +       PeekNamedPipe fails with ERROR_BR

Re: lib/poll.c, win32 SIGHUP on pipes

2010-08-22 Thread Erik Faye-Lund
On Mon, Aug 23, 2010 at 12:32 AM, Erik Faye-Lund wrote: > I've recently looked into replacing the poll-emulation in Git for > Windows with the code from gnulib, due to the improved pipe-support in > gnulib. > > However, I've noticed that win32_compute_revents() n

lib/poll.c, win32 SIGHUP on pipes

2010-08-22 Thread Erik Faye-Lund
I've recently looked into replacing the poll-emulation in Git for Windows with the code from gnulib, due to the improved pipe-support in gnulib. However, I've noticed that win32_compute_revents() never returns SIGHUP for FILE_TYPE_PIPE, which is something the code I'm trying to port currently depe