summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorantirez <antirez@gmail.com>2011-09-14 19:05:21 +0200
committerantirez <antirez@gmail.com>2011-09-19 17:43:07 +0200
commit411cb75bcdd183915fbf7765a942fb2ddd99619f (patch)
treec820a52fc4fb4b05f571c320b243bd69d070bdb4
parent794419192e2a17cedcad29c98b58add730626370 (diff)
downloadredis-411cb75bcdd183915fbf7765a942fb2ddd99619f.tar.gz
Better comments for bioWaitPendingJobsLE
-rw-r--r--src/bio.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/bio.c b/src/bio.c
index 108140f7a..882d4183b 100644
--- a/src/bio.c
+++ b/src/bio.c
@@ -140,7 +140,15 @@ unsigned long long bioPendingJobsOfType(int type) {
* less or equal to the specified number.
*
* This function may block for long time, it should only be used to perform
- * special tasks like AOF rewriting or alike. */
+ * the following tasks:
+ *
+ * 1) To avoid that the main thread is pushing jobs of a given time so fast
+ * that the background thread can't process them at the same speed.
+ * So before creating a new job of a given type the main thread should
+ * call something like: bioWaitPendingJobsLE(job_type,10000);
+ * 2) In order to perform special operations that make it necessary to be sure
+ * no one is touching shared resourced in the background.
+ */
void bioWaitPendingJobsLE(int type, unsigned long long num) {
unsigned long long iteration = 0;