|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcz.zcu.kiv.ppr.msloup.kernel.Fiber
cz.zcu.kiv.ppr.msloup.userspace.FarmerFiber
public class FarmerFiber
Trida definujici ukazku funkcniho kodu Farmera.
| Constructor Summary | |
|---|---|
FarmerFiber(int workerCount,
int eventCount)
Konstruktor Farmera |
|
| Method Summary | |
|---|---|
protected int |
getStepCount()
Abstraktni metoda ktera varci pocet instrukci v case bloku uvnitr metody step. |
protected void |
step(SysCall sysCall)
Abtraktni metoda pro jeden krok (instrukci) programu ve Fiberu. |
| Methods inherited from class cz.zcu.kiv.ppr.msloup.kernel.Fiber |
|---|
doStep, getEventStructures, getFiberID, getPC, getSleepTo, getState, goTo, ifGoTo, isLastWaitForTimeouted, isWaitOnAllEvents, resetSleep, setLastWaitForTimeouted, setState, setWaitOnAllEvents, sleep |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public FarmerFiber(int workerCount,
int eventCount)
workerCount - pocet pracovniku (spustenych podprocesu)eventCount - celkovy pocet eventu| Method Detail |
|---|
protected int getStepCount()
Fiber
getStepCount in class Fiberprotected void step(SysCall sysCall)
FiberKod teto metody by mohl vypadat napr nasledovne:
switch(PC) {
case 0:
i = 0;
break;
case 1:
ifGoTo(i >= 10, 4);
break;
case 2:
sysCall.getOut().println(i++);
break;
case 3:
goTo(1);
break;
case 4:
break;
}
Pro tento ukazkovy kod musi vracet u getStepCount() jako pocet instrukci cislo 5.
step in class FibersysCall - objekt pro systemove volani
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||