Compare commits

..

No commits in common. "d85cf117541cc4d33dac30f88327c0117fa36fdc" and "b225bbbad926db4876e861031868c8cca751501a" have entirely different histories.

2 changed files with 5 additions and 6 deletions

1
.gitignore vendored
View File

@ -30,7 +30,6 @@
*.dylib *.dylib
# Executables # Executables
out/
*.exe *.exe
*.out *.out
*.app *.app

View File

@ -15,18 +15,18 @@
**Criteria 1:** **Criteria 1:**
- Init is a parent process, which forks child processes P1-P4 (`fork` syscall) - Init is a parent process, which forks child processes P1-P4 (`fork` syscall)
- P1-P4: Process should generate a random integer between 0-19 (random number generation or simply hardcoded) - P1-P4: Process should generate a random integer number between 0-19 (random number generation or simply hardcoded)
- P1-P4 should send the random integer to init through message passing (`pipe` syscall) - P1-P4 should send the random number to init through message passing (`pipe` syscall)
- Init should read data sent by P1-P4 - Init should read data sent by P1-P4
**Criteria 2:** **Criteria 2:**
- Scheduler is an independent process: it should create a shared memory segment (`shmget` and related syscalls) - Scheduler is an independent process: it should create a shared memory segmnet (`shmget` and related syscalls)
- Scheduler should read data (a list of random numbers) written by init, sort the list in ascending order, and print the list (sorting algorithm of choice) - Scheduler should read dadta (a list of random numbers) written by init, sort the list in ascending order, and print the list (sorting algorithm of choice)
**Criteria 3:** **Criteria 3:**
- Init should attach to the shared memory created by the scheduler process (`shmat` and related syscalls, any unique key of choice -> `ftok` syscall is a clean way to accomplish this) - Init should attach to the shared memory created by the scheduler process (`shmat` and related syscalls, hardcoded to any unique key of choice -> `ftok` syscall is a clean way to accomplish this)
- Init should write random numbers from P1-P4 into the shared memory - Init should write random numbers from P1-P4 into the shared memory
**Termination:** **Termination:**