Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
c953f24b
Commit
c953f24b
authored
Jan 12, 2010
by
antirez
Browse files
Added a define to configure how many completed IO jobs the handler should process at every call.
parent
6c96ba7d
Changes
1
Show whitespace changes
Inline
Side-by-side
redis.c
View file @
c953f24b
...
@@ -164,6 +164,12 @@
...
@@ -164,6 +164,12 @@
#define REDIS_VM_MAX_NEAR_PAGES 65536
#define REDIS_VM_MAX_NEAR_PAGES 65536
#define REDIS_VM_MAX_RANDOM_JUMP 4096
#define REDIS_VM_MAX_RANDOM_JUMP 4096
#define REDIS_VM_MAX_THREADS 32
#define REDIS_VM_MAX_THREADS 32
/* The following is the number of completed I/O jobs to process when the
* handelr is called. 1 is the minimum, and also the default, as it allows
* to block as little as possible other accessing clients. While Virtual
* Memory I/O operations are performed by threads, this operations must
* be processed by the main thread when completed to take effect. */
#define REDIS_MAX_COMPLETED_JOBS_PROCESSED 1
/* Client flags */
/* Client flags */
#define REDIS_CLOSE 1 /* This client connection should be closed ASAP */
#define REDIS_CLOSE 1 /* This client connection should be closed ASAP */
...
@@ -7390,6 +7396,7 @@ static void vmThreadedIOCompletedJob(aeEventLoop *el, int fd, void *privdata,
...
@@ -7390,6 +7396,7 @@ static void vmThreadedIOCompletedJob(aeEventLoop *el, int fd, void *privdata,
{
{
char buf[1];
char buf[1];
int retval;
int retval;
int processed = 0;
REDIS_NOTUSED(el);
REDIS_NOTUSED(el);
REDIS_NOTUSED(mask);
REDIS_NOTUSED(mask);
REDIS_NOTUSED(privdata);
REDIS_NOTUSED(privdata);
...
@@ -7487,7 +7494,8 @@ static void vmThreadedIOCompletedJob(aeEventLoop *el, int fd, void *privdata,
...
@@ -7487,7 +7494,8 @@ static void vmThreadedIOCompletedJob(aeEventLoop *el, int fd, void *privdata,
}
}
}
}
}
}
return; /* XXX REMOVE ME */
processed++;
if (processed == REDIS_MAX_COMPLETED_JOBS_PROCESSED) return;
}
}
if (retval < 0 && errno != EAGAIN) {
if (retval < 0 && errno != EAGAIN) {
redisLog(REDIS_WARNING,
redisLog(REDIS_WARNING,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment