view TaskManager/kernel/ppe/Threads.h @ 1531:4443d59a8210 draft

SDL.h in main.cc
author yuhi@cr.ie.u-ryukyu.ac.jp
date Fri, 07 Dec 2012 15:46:27 +0900
parents 622a7d053537
children e8c9a7099bcc
line wrap: on
line source

#ifndef INCLUDED_THREADS
#define INCLUDED_THREADS

#include <pthread.h>
#include "base.h"
#include "types.h"


class Threads {
public:
    BASE_NEW_DELETE(Threads);

    /* constructor */
    Threads(int num = 1) {};
    virtual ~Threads() {};

    /* functions */
    virtual void init() = 0;
    virtual int get_mail(int speid, int count, memaddr *ret) = 0; // BLOCKING
    virtual int has_mail(int speid, int count, memaddr *ret) = 0; // NONBLOCK
    virtual void send_mail(int speid, int num, memaddr *data) = 0; // BLOCKING
    virtual void add_output_tasklist(int command, memaddr buff, int alloc_size) = 0;
    virtual int is_gpu(int cpuid) { return 0; }

    /* variables */
    pthread_t *threads;
    int cpu_num;
}  ;

#endif