implemented a different approach to IO scheduling, so object->storage is no longer used, instead there is a queue and hash table of IO tasks to process, and it is always possible to know what are the scheduled and acrtive IO operations against every single key.

This commit is contained in:
antirez
2011-01-01 21:35:56 +01:00
parent aa81e4d5f4
commit 3be00d7ed6
7 changed files with 190 additions and 156 deletions

View File

@ -21,7 +21,6 @@ robj *createObject(int type, void *ptr) {
/* The following is only needed if VM is active, but since the conditional
* is probably more costly than initializing the field it's better to
* have every field properly initialized anyway. */
o->storage = REDIS_DS_MEMORY;
return o;
}
@ -163,9 +162,6 @@ void decrRefCount(void *obj) {
if (o->refcount <= 0) redisPanic("decrRefCount against refcount <= 0");
if (--(o->refcount) == 0) {
/* DS_SAVING objects should always have a reference in the
* IO Job structure. So we should never reach this state. */
redisAssert(o->storage != REDIS_DS_SAVING);
switch(o->type) {
case REDIS_STRING: freeStringObject(o); break;
case REDIS_LIST: freeListObject(o); break;