今日の作業
新スケジューラの実装開始。
いろいろ気が散ってなかなか進まず。
自分は集中力がないのが大きな弱点だ。
class Scheduler2
{
public:
Scheduler2();
virtual ~Scheduler2();
public:
bool Schedule1();
bool Schedule2();
protected:
void SetPriority(Thread* thread);
void WakeupTimer();
void WakeupTimer(Thread* thread);
bool SetNextThread();
inline void RemoveAdd(Array<Thread*> queue, Thread* thread)
{
#if 1
if (thread->priority >= queue.getLength() || thread->priority < 0)
{
panic("Scheduler:RemoveAdd index out");
}
#endif
thread->remove();
queue[thread->priority]->addToPrev(thread);
}
protected:
Array<Thread*> runq;
Array<Thread*> waitq;
dword tickTotal;
};