public CacheBlock getNextBlock( )
		{
			CacheBlock currentBlock = null;
			boolean blockAvailable = false;
			while( !blockAvailable )
			{
				int bloque = currentBlockNumber.incrementAndGet();
				if( bloque == cacheBlocksSize )
				{
					bloque = 0;
					currentBlockNumber.set(0);
				}

				currentBlock = cacheBlocks[bloque];

				switch(currentBlock.getBlockState( ))
				{
				case CLEAN:
					if( currentBlock.getBlockRef() )
					{
						currentBlock.changeRef( false );
						cacheBlocks[bloque] = currentBlock;
					}
					else
					{
						blockAvailable = true;
					}
					break;
				case DIRTY:
					diskQueue.write( currentBlock.getBlockNumber(), currentBlock.getData() );
					currentBlock.changeState(CacheBlock.State.CLEAN);
					currentBlock.changeRef( true );
					cacheBlocks[bloque] = currentBlock;
				case EMPTY:
					blockAvailable = true;
				}

			}
			return currentBlock;
		}