Split program into three files, added arguments for fork amounts, and passes sharedID into forks for exec

This commit is contained in:
2022-10-13 23:10:33 -05:00
parent 8339af50c4
commit a22970ff41
8 changed files with 121 additions and 39 deletions
-4
View File
@@ -1,8 +1,4 @@
#ifndef CONSUMER_H
#define CONSUMER_H
void* Consumer(void* arg);
void consume_item(long int item);
long int remove_item(void);
#endif
-3
View File
@@ -1,8 +1,5 @@
#ifndef PRODUCER_H
#define PRODUCER_H
void* Producer(void* arg);
long int produce_item(void);
void insert_item(long int item);
#endif
+2
View File
@@ -2,6 +2,8 @@
#define SHARED_H
#include <semaphore.h>
int StringToNumber(char* argv);
typedef struct SharedStruct
{
int buffer[10];