Strumenti Utente

Strumenti Sito


lpr-b-2007-2008: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-2007-2008/tasktpconcurr.txt · Ultima modifica: 19/09/2008 alle 14:08 (11 anni fa) (modifica esterna)