view DPP/queue.h @ 33:3946f8d26710 draft default tip

add benchmarck/binary-trees
author Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
date Tue, 09 Apr 2013 16:41:30 +0900
parents 6695c97470f3
children
line wrap: on
line source

/*
    OS Scheduler Simulator

** 連絡先: 琉球大学情報工学科 河野 真治  
** (E-Mail Address: kono@ie.u-ryukyu.ac.jp)
**
**    このソースのいかなる複写,改変,修正も許諾します。ただし、
**    その際には、誰が貢献したを示すこの部分を残すこと。
**    再配布や雑誌の付録などの問い合わせも必要ありません。
**    営利利用も上記に反しない範囲で許可します。
**    バイナリの配布の際にはversion messageを保存することを条件とします。
**    このプログラムについては特に何の保証もしない、悪しからず。
**
**    Everyone is permitted to do anything on this program 
**    including copying, modifying, improving,
**    as long as you don't try to pretend that you wrote it.
**    i.e., the above copyright notice has to appear in all copies.  
**    Binary distribution requires original version messages.
**    You don't have to ask before copying, redistribution or publishing.
**    THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE.

  Task Queue Manager

** modify: Atsuki Shimoji(atsuki@cr.ie.u-ryukyu.ac.jp)

 */
#ifndef _QUEUE_H_
#define _QUEUE_H_
#include "dpp_common.h"
#include "state_db.h"

typedef struct task {
	struct task *next;
	struct phils *phils;
} Task, *TaskPtr;

typedef struct task_iterator {
    struct task_iterator *prev;
    StateDB state;
    TaskPtr list;
    TaskPtr last;
} TaskIterator, *TaskIteratorPtr;

extern TaskIteratorPtr
create_task_iterator(TaskPtr list,StateDB s,TaskIteratorPtr prev);

extern TaskPtr
next_task_iterator(TaskIteratorPtr self);

extern void
free_task_iterator(TaskIteratorPtr iter);

extern 
code create_queue(int count, PhilsPtr self, TaskPtr list, TaskPtr last,
            code (*dest)(
                int count,PhilsPtr self, TaskPtr list,TaskPtr last, TaskPtr q
            ));
/*
extern
code enqueue(int count, PhilsPtr self, TaskPtr list, TaskPtr last, TaskPtr q,
                code (*dest)(
            int count, PhilsPtr self, TaskPtr list, TaskPtr last, TaskPtr q,
        ));
*/
extern
code enqueue(int count, PhilsPtr self, TaskPtr list, TaskPtr last, TaskPtr q,
	     code (*dest)()
        );


extern void free_queue(TaskPtr q);
extern code dequeue(code (*dest)(), TaskPtr list, TaskPtr *q);

#endif