cz.zcu.kiv.ppr.msloup.kernel
Class CPU

java.lang.Object
  extended by java.lang.Thread
      extended by cz.zcu.kiv.ppr.msloup.kernel.CPU
All Implemented Interfaces:
Runnable

public class CPU
extends Thread

Trida reprezentujici Procesor

Author:
Martin Sloup

Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
Thread.State, Thread.UncaughtExceptionHandler
 
Field Summary
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
CPU(Scheduler scheduler, SysCall sysCall)
          Konstruktor CPU
 
Method Summary
protected static CPU currentCPU()
          Vraci referenci na aktualni bezici CPU.
protected  int getCPUID()
          Vraci jednoznacny identifikator CPU
protected  Fiber getFiber()
          Vraci Fiber, ktery bezi na tomto CPU
static long milisTime()
          Vraci aktualni cas v milisekundach.
 void run()
          Hlavni metoda behu CPU
 
Methods inherited from class java.lang.Thread
activeCount, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, checkAccess, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CPU

public CPU(Scheduler scheduler,
           SysCall sysCall)
Konstruktor CPU

Parameters:
scheduler - objekt planovace vlaken
sysCall - objekt systemovych volani uzivanych ve Fiberech
Method Detail

run

public void run()
Hlavni metoda behu CPU

Specified by:
run in interface Runnable
Overrides:
run in class Thread

getCPUID

protected int getCPUID()
Vraci jednoznacny identifikator CPU

Returns:
identifikator CPU

getFiber

protected Fiber getFiber()
Vraci Fiber, ktery bezi na tomto CPU

Returns:
Fiber

currentCPU

protected static CPU currentCPU()
Vraci referenci na aktualni bezici CPU. Je-li volano z Fiberu, vraci CPU na kterem bezi.

Returns:
referenci na CPU

milisTime

public static long milisTime()
Vraci aktualni cas v milisekundach.

Returns:
cas v milisekundach