java 实现的P2P Chord算法。chord算法是结构式的P2P搜索与管理协议

源代码在线查看: gestorpooling.java

软件大小: 209 K
上传用户: albert333
关键词: P2P Chord chord java
下载地址: 免注册下载 普通下载 VIP

相关代码

				/*				 * GestorPooling.java				 *				 * Created on 14 de abril de 2005, 15:48				 */								package org.mikel.jchord.red;												import java.util.*;				/**				 *				 * @author mikel				 */				public class GestorPooling {				    				    private Vector colaEjecutables;				    				    /** Creates a new instance of GestorPoolThreads */				    public GestorPooling(int tama駉) {				        				        colaEjecutables = new Vector(1,10);				        for(int i=0; i				            new EjecutorParaPool(this);        				        }				    }				    				    synchronized void esperarEjecucion (EjecutorParaPool ejecutor) throws InterruptedException{				      				        				        while(colaEjecutables.size()==0)				            wait();				        				        Runnable e = (Runnable) colaEjecutables.elementAt(0);				        colaEjecutables.removeElementAt(0);				        ejecutor.ejecutar(e);				          				    }				    				    synchronized void a馻dir(Runnable r){				    				        colaEjecutables.addElement(r);				        notify();    				    }				    				}							

相关资源