-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprocess.h
More file actions
29 lines (22 loc) · 733 Bytes
/
process.h
File metadata and controls
29 lines (22 loc) · 733 Bytes
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
#ifndef __IFMO_DISTRIBUTED_CLASS_COMMON__INFO_H
#define __IFMO_DISTRIBUTED_CLASS_COMMON__INFO_H
#include <unistd.h>
#include <stdbool.h>
#include "ipc.h"
extern int r_ends[MAX_PROCESS_ID][MAX_PROCESS_ID];
extern int w_ends[MAX_PROCESS_ID][MAX_PROCESS_ID];
typedef struct {
local_id id; /// identifier of a process, parent has 0, children - [1 ; n]
bool is_parent;
int processes_count; /// amount of processes in system including parent
} __attribute__((packed)) Process;
typedef enum {
READ,
WRITE
} EndType;
typedef struct {
EndType type;
int sender_id;
int receiver_id;
} __attribute__((packed)) ChannelEnd;
#endif //__IFMO_DISTRIBUTED_CLASS_COMMON__INFO_H