Compare commits
No commits in common. "552f95fe99b94023cc23d239a81b2b7a3ab2a867" and "f93eba6eb936db5a03753fe68f4971f66f9d6cda" have entirely different histories.
552f95fe99
...
f93eba6eb9
@ -4,5 +4,4 @@
|
||||
4. The print thread will wait on the sim sem for each CPU thread, and this should leave the sem at 0 again.
|
||||
5. At the end of the print function, before the simulation is allowed to print again, the print thread will increase the time, and then post to the sim sem for each CPU thread, so the simulation can start again.
|
||||
6. Repeat steps 3-5 until the simulation is done.
|
||||
|
||||
This is the general process, at least at the time I wrote this down lmao
|
||||
7.
|
@ -1,23 +0,0 @@
|
||||
# How to run
|
||||
|
||||
To compile please run:
|
||||
```shell
|
||||
gcc -Ilib lib/process.c lib/queue.c hard_affinity.c
|
||||
```
|
||||
|
||||
And to run please run:
|
||||
```shell
|
||||
./a.out < example.txt
|
||||
```
|
||||
|
||||
# In case of error
|
||||
|
||||
If that command to compile does not work, please place all C and C header files in the same directory and run:
|
||||
```shell
|
||||
gcc process.c queue.c hard_affinity.c
|
||||
```
|
||||
|
||||
In case you need to move the files, for easy copying:
|
||||
```shell
|
||||
mv lib/process.c . & mv lib/queue.c . & mv lib/queue.h . & mv lib/process.h .
|
||||
```
|
@ -4,22 +4,6 @@
|
||||
#include <stdlib.h>
|
||||
#include "lib/queue.h"
|
||||
|
||||
/*
|
||||
* Marker, please read:
|
||||
*
|
||||
* There is a bug that I cannot track down/may be unsolvable with my current implementation.
|
||||
* It's where *sometimes* the print function, after a thread finishes, it will print an extra time on one job (I think)
|
||||
*
|
||||
* This could probably be solved by running the "done threads" until all threads are complete, but I didn't have time to bugfix that
|
||||
* implementation. I tried it, but it didn't work as is, so I reverted it.
|
||||
*
|
||||
* With that implementation it may have been beneficial to have an array of semaphores, one for each "CPU", that the print thread
|
||||
* can for loop wait on each to complete. I think that would have worked, but I straight up didn't have time to implement it or try at all
|
||||
*
|
||||
* The comments may also not be the most helpful, didn't have time to go and clean them up
|
||||
*/
|
||||
|
||||
|
||||
#define MAX_USERNAME_LENGTH 100
|
||||
int *QUANTUM;
|
||||
int CPUS;
|
||||
|
Binary file not shown.
Loading…
Reference in New Issue
Block a user