projects/virtual_memory_manager/scheduler.cpp
//Sorts processes in the order of arrival and populates the procT queue
Sorts processes in the order of arrival and populates the procT queue
Sorts processes in the order of arrival and populates the procT queue
void Scheduler::sortProcesses()
    {
        std::sort(pData->processes.begin(), pData->processes.end());
        for (int i = 0; i < pData->processes.size(); i++)
        {
            Parser::Process tempProc = pData->processes.at(i);
            procT *tempThread = new procT(tempProc.arrivalTime, tempProc.serviceTime, tempProc.id, this->logger, this->cmdBuffer, this->commands, this->timer);
            this->processes.push(tempThread);
        }
    }
void Scheduler :: sortProcesses ( ) { std :: sort ( pData -> processes . begin ( ) , pData -> processes . end ( ) ) ; for ( int i = 0 ; i < pData -> processes . size ( ) ; i ++ ) { Parser :: Process tempProc = pData -> processes . at ( i ) ; procT * tempThread = new procT ( tempProc . arrivalTime , tempProc . serviceTime , tempProc . id , this -> logger , this -> cmdBuffer , this -> commands , this -> timer ) ; this -> processes . push ( tempThread ) ; } }
Sorts processes in the order of arrival and populates the procT queue
Sorts processes in the order of arrival and populates the procT queue