-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscheduler.h
41 lines (30 loc) · 1.01 KB
/
scheduler.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
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include "pth.h"
#ifndef __SCHEDULER_H__
#define __SCHEDULER_H__
// variables
unsigned timeInst; // global to synchronize time accross tasks
unsigned dataCollectionCtr; // global used to count robots processed
// constants
#define MAX_THREADS 7
void *thread_1(void *ptr);
void *thread_2(void *ptr);
int scheduler(void);
// external functions
// send data to the interested listeners, position, speed, obstables, etc.
void* sendData(void* ptr);
// receive data from liek position, speed, obstables, etc from members I have subscribed
void* receiveData(void* ptr);
// makes the subscriptions
void* mcastSubscribe(void* ptr);
// makes the unsubscriptions
void* mcastUnSubscribe(void* ptr);
// selects the near neighbors to subscribe to their transmitted data
void* dataSelection(void* ptr);
// process the data from selected bots
void* dataProcessing(void* ptr);
// makes decision based on processed data
void* decisionMaking(void* ptr);
#endif // __SCHEDULER_H__