view TaskManager/kernel/ppe/TaskManagerImpl.h @ 619:0decff4e867b

RenewTask removal
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Sun, 15 Nov 2009 02:02:30 +0900
parents 47b61865ea8c
children 0558abba673c
line wrap: on
line source

#ifndef INCLUDED_TASK_MANAGER_IMPL
#define INCLUDED_TASK_MANAGER_IMPL

#include "MailManager.h"
#include "ListData.h"
#include "TaskListInfo.h"
#include "TaskQueueInfo.h"
#include "HTaskInfo.h"
class Scheduler;
class MemList;


class TaskManagerImpl {
public:

    /* variables */
    int machineNum;
    HTaskInfo *activeTaskQueue;
    HTaskInfo *waitTaskQueue;

    TaskListInfo *taskListImpl;
    TaskQueueInfo *taskQueueImpl;
    HTaskInfo *htaskImpl;

    SchedTask *schedTaskManager;

    /* constructor */
    TaskManagerImpl(int num = 1) ;

    virtual ~TaskManagerImpl() { }

    /* functions */
    // system
    virtual void init() = 0;
    virtual void run() = 0;
    virtual void append_activeTask(HTaskPtr);
    virtual void append_waitTask(HTaskPtr);

    void check_task_finish(HTaskPtr task);
    void wakeup_waitTask();

    void systask_init();

    // user
    HTaskPtr create_task(int cmd);
    void set_task_depend(HTaskPtr master, HTaskPtr slave);
    void spawn_task(HTaskPtr);
    void set_task_cpu(HTaskPtr, CPU_TYPE);

    virtual void* allocate(int size) = 0;
    virtual void* allocate(int size,int align) = 0;
    virtual Scheduler* get_scheduler() = 0;
};

#endif