Re: ntdll: make NtDelayExecution a bit more efficient

2013-03-11 Thread Graham Knap
Francois Gouget wrote: > I think it's really a three patch series and the first one has the > clearer commit message: > > Made NtDelayExecution with a 0 timeout yield the CPU, as it is > supposed to. I agree that this is the correct behaviour for the "zero timeout" case. The comments that

Re: ntdll: make NtDelayExecution a bit more efficient

2013-03-08 Thread Francois Gouget
On Fri, 8 Mar 2013, Juan Lang wrote: [...] > > Michael Stefaniuc wrote: > > >> i.e. commit 8099c2b9. JW says "... to more closely resemble Windows > > >> behavior. The key is to yield in a Sleep..." I think it's really a three patch series and the first one has the clearer commit message: commi

Re: ntdll: make NtDelayExecution a bit more efficient

2013-03-08 Thread Juan Lang
On Fri, Mar 8, 2013 at 6:11 AM, Graham Knap wrote: > Michael Stefaniuc wrote: > >> i.e. commit 8099c2b9. JW says "... to more closely resemble Windows > >> behavior. The key is to yield in a Sleep..." > > > > JW is Jeremy White so us old timers chuckle now ;) > > I know the name, but nothing mor

Re: ntdll: make NtDelayExecution a bit more efficient

2013-03-08 Thread Stefan Dösinger
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Am 2013-03-08 15:11, schrieb Graham Knap: > Michael Stefaniuc wrote: >> If the ancient wisdom isn't backed by tests there's a fair chance >> that it might not be applicable today. Or that it was a wrong >> theory This is guesswork, but maybe the yield

Re: ntdll: make NtDelayExecution a bit more efficient

2013-03-08 Thread Graham Knap
Michael Stefaniuc wrote: >> i.e. commit 8099c2b9. JW says "... to more closely resemble Windows >> behavior. The key is to yield in a Sleep..." > > JW is Jeremy White so us old timers chuckle now ;) I know the name, but nothing more. Why is this funny? > If the ancient wisdom isn't backed by tes

Re: ntdll: make NtDelayExecution a bit more efficient

2013-03-06 Thread Michael Stefaniuc
On 03/06/2013 07:10 PM, Graham wrote: > Alexandre wrote: >> That's what the existing code already does. > > Indeed. I don't know what I was thinking... > >>> 2. If you're about to block on select(), then I don't see any point in >>> preceding that with a call to sched_yield(). >> >> This was adde

Re: ntdll: make NtDelayExecution a bit more efficient

2013-03-06 Thread Graham
Alexandre wrote: > That's what the existing code already does. Indeed. I don't know what I was thinking... >> 2. If you're about to block on select(), then I don't see any point in >> preceding that with a call to sched_yield(). > > This was added for a reason; most likely you'll have to write te

ntdll: make NtDelayExecution a bit more efficient

2013-03-06 Thread Joerg-Cyril.Hoehle
You may try and find that MSDN or blog page where people explain the subtle differences of Sleep(0) and Sleep(1) on multi-core machines. Regards, Jörg Höhle

Re: ntdll: make NtDelayExecution a bit more efficient

2013-03-06 Thread Alexandre Julliard
Graham writes: > This patch is vaguely related to bug 24558. It eliminates a few > syscalls in NtDelayExecution: > > 1. If the caller requests a zero-wait yield, then do just that, and > nothing more. That's what the existing code already does. > 2. If you're about to block on select(), then I