mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-23 00:41:02 +00:00
Minor twaek to improve responsiveness on heavily loaded systems.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@11550 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
c64258cddf
commit
000f954c4f
3 changed files with 21 additions and 6 deletions
|
@ -1,3 +1,10 @@
|
|||
2001-11-27 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* Source/NSConnection.m: Put a limit of around a second on how long
|
||||
the delay between polling for incoming packets can grow to ...
|
||||
improve response on heavily loaded systems.
|
||||
* Source/GSHTTPURLHandle.m: ditto
|
||||
|
||||
2001-11-24 Fred Kiefer <FredKiefer@gmx.de>
|
||||
|
||||
* Headers/Foundation/NSURL.h
|
||||
|
|
|
@ -421,10 +421,13 @@ static NSLock *urlLock = nil;
|
|||
when = [NSDate alloc];
|
||||
while (tunnel == YES)
|
||||
{
|
||||
NSTimeInterval tmp = limit;
|
||||
if (limit < 1.0)
|
||||
{
|
||||
NSTimeInterval tmp = limit;
|
||||
|
||||
limit += last;
|
||||
last = tmp;
|
||||
limit += last;
|
||||
last = tmp;
|
||||
}
|
||||
when = [when initWithTimeIntervalSinceNow: limit];
|
||||
[loop runUntilDate: when];
|
||||
}
|
||||
|
|
|
@ -2406,12 +2406,17 @@ static void callEncoder (DOContext *ctxt)
|
|||
* by setting a small delay and increasing it each time round
|
||||
* so that this semi-busy wait doesn't consume too much
|
||||
* processor time (I hope).
|
||||
* We set an upper limit on the delay to avoid responsiveness
|
||||
* problems.
|
||||
*/
|
||||
RELEASE(delay_date);
|
||||
delay_date = [dateClass allocWithZone: NSDefaultMallocZone()];
|
||||
next_interval = last_interval + delay_interval;
|
||||
last_interval = delay_interval;
|
||||
delay_interval = next_interval;
|
||||
if (delay_interval < 1.0)
|
||||
{
|
||||
next_interval = last_interval + delay_interval;
|
||||
last_interval = delay_interval;
|
||||
delay_interval = next_interval;
|
||||
}
|
||||
delay_date
|
||||
= [delay_date initWithTimeIntervalSinceNow: delay_interval];
|
||||
|
||||
|
|
Loading…
Reference in a new issue