Biblioteca Java - Rev 25
Subversion Repositories:
import java.util.Observable;
public class Fir extends Observable implements Runnable {
int id;
int c;
int processorLoad;
Thread t;
Fir(int id, int priority, int procLoad) {
this.id = id;
t = new Thread(this);
t.setPriority(priority);
t.start();
System.out.println("Started "+t.getName());
this.processorLoad = procLoad;
}
public String getName(){
return t.getName();
}
public void run() {
while (c < 1000) {
for (int j = 0; j < this.processorLoad; j++) {
j++;
j--;
}
c++;
this.setChanged();
this.notifyObservers();
}
}
}
public class Fir extends Observable implements Runnable {
int id;
int c;
int processorLoad;
Thread t;
Fir(int id, int priority, int procLoad) {
this.id = id;
t = new Thread(this);
t.setPriority(priority);
t.start();
System.out.println("Started "+t.getName());
this.processorLoad = procLoad;
}
public String getName(){
return t.getName();
}
public void run() {
while (c < 1000) {
for (int j = 0; j < this.processorLoad; j++) {
j++;
j--;
}
c++;
this.setChanged();
this.notifyObservers();
}
}
}