Expand description
§Project 4: Synchronization and Multithreading
In Project 4, you will expand KeOS’s process abstraction to support multithreading. You will implement basic synchronization primitives such as mutexes, condition variables, and semaphores to synchronize resources between threads.
Synchronization primitives will be used to support correct multithreaded behavior. For example, thread join functionality will be built using semaphores, which themselves are implemented using a combination of mutexes and condition variables.
Finally, you will improve the scheduler by implementing a round-robin scheduling algorithm. Unlike previous projects where the unit of scheduling was the entire process, starting from this project, the unit of scheduling becomes an individual thread.
§Getting Started
To get started, navigate to the keos-project4/grader directory and run:
$ cargo run§Modifiable Files
In this project, you can modify the following five files:
sync/mutex.rssync/condition_variable.rssync/semaphore.rsprocess.rsround_robin.rs
§Project Outline
-
- Mutex: Provide mutual exclusion.
- Condition Variable: Enable waiting for conditions.
- Semaphore: Implement higher-level synchronization using mutex and condition variables.
-
MultiThreading: Implement thread creation, termination, and and join mechanisms. -
Round Robin Scheduler: Implement a round-robin scheduler that switches between threads fairly, using time slices.
Re-exports§
pub use process::Thread;
Modules§
- process
- Multithreaded Process
- round_
robin - Multicore Round-Robin Scheduling.
- sync
- Synchronization Primitives.
Enums§
- Syscall
Number - Represents system call numbers used in project4.