-
Notifications
You must be signed in to change notification settings - Fork 0
/
jobs.h
47 lines (37 loc) · 893 Bytes
/
jobs.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
/*
* File: Jobs.h
* Author: Danni Friedland & Yaniv Dudu
*
* Created on April 12, 2010, 8:09 PM
*/
#ifndef _JOBS_H
#define _JOBS_H
#include "globalDefs.h"
#include "ydThreads.h"
typedef enum JobState
{
NotStarted=1,
InProgress=2,
Done=3
} JobState;
typedef struct sThreadJobs
{
int jobsAmount;
tID threadID;
tID* jobs;
} ThreadJobs,*pThreadJobs;
typedef JobState* Jobs;
typedef boolean** JobsDeps; //dependencies between jobs, the graph matrix
typedef ThreadJobs* JobsForThreads; //relation between the threads and the jobs
boolean hasPendingJobs (tID threadId);
/* return next job for thread.*/
tID getJobForThread (tID threadId);
/* execute the job by changind the job status to done */
op_status execJob (tID jobId);
void printData();
JobsForThreads jobsForThreads;
Jobs jobs;
JobsDeps deps;
int threadsAmount;
int jobsAmount;
#endif /* _JOBS_H */