Strumenti Utente

Strumenti Sito


lpr-b:tasktpconcurr
package threadPoolConcurrency;
 
public class Task<T,R> implements Runnable {
 
	Compute<T,R> fun = null; 
	T task = null; 
	Repository<R> results = null; 
 
	public Task(T task, Compute<T,R>fun, Repository<R> results) {
		this.fun = fun; 
		this.task = task;
		this.results = results; 
	}
 
	public void run() {
		R result = fun.compute(task);
		results.insert(result);
		return;
	}
 
}
lpr-b/tasktpconcurr.txt · Ultima modifica: 22/10/2007 alle 14:38 (14 anni fa) da Marco Danelutto