mirror of
https://github.com/bspeice/itcs3146-project
synced 2024-11-14 12:08:35 -05:00
25 lines
632 B
Java
25 lines
632 B
Java
class threadedAllocationGarbage extends Thread
|
|
{
|
|
/* This class implements the garbage collecting functionality for the
|
|
* threaded allocation algorithm.
|
|
* It had to be put in a separate class since it implements a threading
|
|
* interface */
|
|
|
|
int[] memoryBlock;
|
|
int sleepTime;
|
|
|
|
threadedAllocationGarbage( int[] memoryBlock, int sleepTime ){
|
|
/* Set up a reference to the algorithm's memory location */
|
|
this.memoryBlock = memoryBlock;
|
|
|
|
/* Set up the time quantum */
|
|
this.sleepTime = sleepTime;
|
|
}
|
|
|
|
public void run() {
|
|
/* Code to run in the background */
|
|
|
|
//Sleep for sleepTime, then scan for memory to compact
|
|
}
|
|
}
|