Re: yield API

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Kyle Moffett
Subject: Re: yield API
Date: Wednesday, December 12, 2007 - 9:43 pm

On Dec 12, 2007, at 17:39:15, Jesper Juhl wrote:

That is a *terrible* disgusting way to use yield.  Better options:
   (1) inotify/dnotify
   (2) create a "foo.lock" file and put the mutex in that
   (3) just start with the check-file-and-sleep loop.



It works better than doing the wait-loop from the start?  What  
evidence do you provide to support this assertion?  Specifically, in  
the first case you tell the kernel "I'm waiting for something but I  
don't know what it is or how long it will take"; while in the second  
case you tell the kernel "I'm waiting for something that will take  
exactly X milliseconds, even though I don't know what it is.  If you  
really want something similar to the old behavior then just replace  
the "sched_yield()" call with a proper sleep for the estimated time  
it will take the program to create the file.



We weren't looking for "actual uses", especially not in binary-only  
apps.  What we are looking for is optimal uses of sched_yield(); ones  
where that is the best alternative.  This... certainly isn't.

Cheers,
Kyle Moffett

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Network slowdown due to CFS, Martin Michlmayr, (Wed Sep 26, 1:52 am)
Re: Network slowdown due to CFS, Ingo Molnar, (Wed Sep 26, 2:34 am)
Re: Network slowdown due to CFS, Ingo Molnar, (Wed Sep 26, 2:47 am)
Re: Network slowdown due to CFS, Martin Michlmayr, (Wed Sep 26, 3:08 am)
Re: Network slowdown due to CFS, Ingo Molnar, (Wed Sep 26, 3:18 am)
Re: Network slowdown due to CFS, Mike Galbraith, (Wed Sep 26, 3:20 am)
Re: Network slowdown due to CFS, Mike Galbraith, (Wed Sep 26, 3:23 am)
Re: Network slowdown due to CFS, Martin Michlmayr, (Wed Sep 26, 3:48 am)
Re: Network slowdown due to CFS, Ingo Molnar, (Wed Sep 26, 4:21 am)
Re: Network slowdown due to CFS, Martin Michlmayr, (Wed Sep 26, 4:29 am)
RE: Network slowdown due to CFS, David Schwartz, (Wed Sep 26, 5:00 am)
Re: Network slowdown due to CFS, Ingo Molnar, (Wed Sep 26, 6:31 am)
Re: Network slowdown due to CFS, Stephen Hemminger, (Wed Sep 26, 8:40 am)
Re: Network slowdown due to CFS, Stephen Hemminger, (Wed Sep 26, 8:46 am)
Re: Network slowdown due to CFS, Jarek Poplawski, (Thu Sep 27, 2:30 am)
Re: Network slowdown due to CFS, Ingo Molnar, (Thu Sep 27, 2:46 am)
Re: Network slowdown due to CFS, Ingo Molnar, (Thu Sep 27, 2:49 am)
Re: Network slowdown due to CFS, Martin Michlmayr, (Thu Sep 27, 3:54 am)
Re: Network slowdown due to CFS, Ingo Molnar, (Thu Sep 27, 3:56 am)
Re: Network slowdown due to CFS, Martin Michlmayr, (Thu Sep 27, 4:12 am)
Re: Network slowdown due to CFS, Jarek Poplawski, (Thu Sep 27, 5:27 am)
Re: Network slowdown due to CFS, Ingo Molnar, (Thu Sep 27, 6:31 am)
Re: Network slowdown due to CFS, Jarek Poplawski, (Thu Sep 27, 7:42 am)
Re: Network slowdown due to CFS, Nick Piggin, (Thu Sep 27, 11:10 pm)
Re: Network slowdown due to CFS, Jarek Poplawski, (Mon Oct 1, 1:43 am)
Re: Network slowdown due to CFS, Ingo Molnar, (Mon Oct 1, 9:25 am)
RE: Network slowdown due to CFS, David Schwartz, (Mon Oct 1, 9:49 am)
Re: Network slowdown due to CFS, Chris Friesen, (Mon Oct 1, 9:55 am)
Re: Network slowdown due to CFS, Ingo Molnar, (Mon Oct 1, 10:09 am)
Re: Network slowdown due to CFS, Ingo Molnar, (Mon Oct 1, 10:31 am)
Re: Network slowdown due to CFS, Chris Friesen, (Mon Oct 1, 10:45 am)
RE: Network slowdown due to CFS, David Schwartz, (Mon Oct 1, 11:23 am)
Re: iperf yield usage, Ingo Molnar, (Mon Oct 1, 12:09 pm)
Re: Network slowdown due to CFS, Arjan van de Ven, (Mon Oct 1, 12:53 pm)
RE: Network slowdown due to CFS, David Schwartz, (Mon Oct 1, 3:17 pm)
Re: Network slowdown due to CFS, Arjan van de Ven, (Mon Oct 1, 3:35 pm)
RE: Network slowdown due to CFS, David Schwartz, (Mon Oct 1, 3:44 pm)
Re: Network slowdown due to CFS, Arjan van de Ven, (Mon Oct 1, 3:55 pm)
Re: Network slowdown due to CFS, Ingo Molnar, (Mon Oct 1, 11:06 pm)
Re: Network slowdown due to CFS, Ingo Molnar, (Mon Oct 1, 11:08 pm)
Re: Network slowdown due to CFS, Ingo Molnar, (Mon Oct 1, 11:26 pm)
Re: yield API, Ingo Molnar, (Mon Oct 1, 11:46 pm)
Re: Network slowdown due to CFS, Andi Kleen, (Mon Oct 1, 11:47 pm)
Re: Network slowdown due to CFS, Jarek Poplawski, (Tue Oct 2, 2:03 am)
Re: Network slowdown due to CFS, Jarek Poplawski, (Tue Oct 2, 2:26 am)
Re: yield API, linux-os (Dick Johnson), (Tue Oct 2, 4:50 am)
Re: Network slowdown due to CFS, Jarek Poplawski, (Tue Oct 2, 6:39 am)
Re: yield API, Douglas McNaught, (Tue Oct 2, 8:24 am)
RE: Network slowdown due to CFS, David Schwartz, (Tue Oct 2, 8:37 am)
Re: yield API, Eric St-Laurent, (Tue Oct 2, 2:57 pm)
Re: Network slowdown due to CFS, Jarek Poplawski, (Wed Oct 3, 12:15 am)
Re: Network slowdown due to CFS, Jarek Poplawski, (Wed Oct 3, 1:02 am)
Re: Network slowdown due to CFS, Ingo Molnar, (Wed Oct 3, 1:16 am)
Re: Network slowdown due to CFS, Jarek Poplawski, (Wed Oct 3, 1:56 am)
Re: Network slowdown due to CFS, Ingo Molnar, (Wed Oct 3, 2:10 am)
Re: Network slowdown due to CFS, Jarek Poplawski, (Wed Oct 3, 2:50 am)
Re: Network slowdown due to CFS, Dmitry Adamushko, (Wed Oct 3, 3:55 am)
Re: Network slowdown due to CFS, Dmitry Adamushko, (Wed Oct 3, 3:58 am)
Re: Network slowdown due to CFS, Jarek Poplawski, (Wed Oct 3, 4:20 am)
Re: Network slowdown due to CFS, Ingo Molnar, (Wed Oct 3, 4:22 am)
Re: Network slowdown due to CFS, Helge Hafting, (Wed Oct 3, 4:31 am)
Re: Network slowdown due to CFS, Jarek Poplawski, (Wed Oct 3, 4:40 am)
Re: yield, Ingo Molnar, (Wed Oct 3, 4:56 am)
Re: yield, Jarek Poplawski, (Wed Oct 3, 5:16 am)
RE: Network slowdown due to CFS, Rusty Russell, (Wed Oct 3, 5:31 pm)
Re: Network slowdown due to CFS, Casey Dahlin, (Wed Oct 3, 10:33 pm)
Re: Network slowdown due to CFS, Ingo Molnar, (Sun Oct 7, 12:18 am)
Re: yield API, Kyle Moffett, (Wed Dec 12, 9:43 pm)
RE: yield API, David Schwartz, (Thu Dec 13, 1:10 pm)