Tweaks to NSConnection

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@11089 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-Macdonald 2001-10-06 18:12:53 +00:00
parent 13b7308dc1
commit 2d9c947609
6 changed files with 674 additions and 550 deletions

View file

@ -1,3 +1,12 @@
2001-10-06 Richard Frith-Macdonald <rfm@gnu.org>
* Source/NSConnection.m: Increase default timeouts to max value.
Improve algorithm for polling for messages when waiting for a reply
in multithreaded mode ... use fibonacci sequence for delays rather
than doubling each time.
* Headers/Foundation/NSConnection.h: Remove default timeout constant.
* configure.in: Check for float.h, not for values.h
2001-10-05 Richard Frith-Macdonald <rfm@gnu.org>
* NSTimeZones/NSTimeZones.tar: Updated to latest info.

View file

@ -232,8 +232,6 @@ GS_EXPORT NSString *ConnectionBecameInvalidNotification;
@end
#define CONNECTION_DEFAULT_TIMEOUT 15.0 /* in seconds */
/*
* NSRunLoop mode, NSNotification name and NSException strings.
*/

View file

@ -64,6 +64,9 @@
/* Define if you have this header */
#undef HAVE_GICONV_H
/* Define if you have this function */
#undef HAVE_ICONV
/* The number of bytes in a double. */
#undef SIZEOF_DOUBLE
@ -172,6 +175,9 @@
/* Define if you have the <dirent.h> header file. */
#undef HAVE_DIRENT_H
/* Define if you have the <float.h> header file. */
#undef HAVE_FLOAT_H
/* Define if you have the <getopt.h> header file. */
#undef HAVE_GETOPT_H
@ -280,9 +286,6 @@
/* Define if you have the <utime.h> header file. */
#undef HAVE_UTIME_H
/* Define if you have the <values.h> header file. */
#undef HAVE_VALUES_H
/* Define if you have the <wchar.h> header file. */
#undef HAVE_WCHAR_H

View file

@ -27,6 +27,9 @@
#include <config.h>
#include <base/preface.h>
#ifdef HAVE_FLOAT_H
#include <float.h>
#endif
/*
* Setup for inline operation of pointer map tables.
@ -820,8 +823,11 @@ static BOOL multi_threaded = NO;
{
_multipleThreads = NO;
_independentQueueing = NO;
_replyTimeout = CONNECTION_DEFAULT_TIMEOUT;
_requestTimeout = CONNECTION_DEFAULT_TIMEOUT;
#ifndef DBL_MAX
#define DBL_MAX 100000000.0
#endif
_replyTimeout = DBL_MAX;
_requestTimeout = DBL_MAX;
/*
* Set up request modes array and make sure the receiving port
* is added to the run loop to get data.
@ -2369,7 +2375,8 @@ static void callEncoder (DOContext *ctxt)
NSPortCoder *rmc;
GSIMapNode node;
NSDate *timeout_date = nil;
NSTimeInterval delay_interval = 0.0001;
NSTimeInterval last_interval = 0.0001;
NSTimeInterval delay_interval = last_interval;
NSDate *delay_date = nil;
NSRunLoop *runLoop = [runLoopClass currentRunLoop];
@ -2389,7 +2396,8 @@ static void callEncoder (DOContext *ctxt)
}
if (_multipleThreads == YES)
{
NSDate *limit_date;
NSDate *limit_date;
NSTimeInterval next_interval;
/*
* If multiple threads are using this connections, another
@ -2401,7 +2409,9 @@ static void callEncoder (DOContext *ctxt)
*/
RELEASE(delay_date);
delay_date = [dateClass allocWithZone: NSDefaultMallocZone()];
delay_interval *= 2;
next_interval = last_interval + delay_interval;
last_interval = delay_interval;
delay_interval = next_interval;
delay_date
= [delay_date initWithTimeIntervalSinceNow: delay_interval];

1180
configure vendored

File diff suppressed because it is too large Load diff

View file

@ -462,9 +462,9 @@ AC_HEADER_STDC
AC_CHECK_HEADERS(string.h memory.h)
#--------------------------------------------------------------------
# Following header check needed BinaryCStream.h
# Following header check needed NSConnection.h
#--------------------------------------------------------------------
AC_CHECK_HEADERS(values.h)
AC_CHECK_HEADERS(float.h)
#--------------------------------------------------------------------
# Header files and functions for files and filesystems