Add content for CPU processes and threads

pull/2907/head
Kamran Ahmed 2 years ago
parent 082593165f
commit 17aa1ae88d
  1. 9
      content/roadmaps/103-computer-science/content/121-processes-and-threads/100-process-forking.md
  2. 8
      content/roadmaps/103-computer-science/content/121-processes-and-threads/101-memory-management.md
  3. 13
      content/roadmaps/103-computer-science/content/121-processes-and-threads/102-lock-mutex-semaphore.md
  4. 6
      content/roadmaps/103-computer-science/content/121-processes-and-threads/103-concurrency-in-multiple-cores.md
  5. 16
      content/roadmaps/103-computer-science/content/121-processes-and-threads/103-scheduling-algorithms.md
  6. 7
      content/roadmaps/103-computer-science/content/121-processes-and-threads/104-cpu-interrupts.md
  7. 8
      content/roadmaps/103-computer-science/content/121-processes-and-threads/105-processes-vs-threads.md
  8. 8
      content/roadmaps/103-computer-science/content/121-processes-and-threads/readme.md

@ -1 +1,8 @@
# Process forking
# Process Forking
Process forking is a way to create a new process from an existing process. The new process is a copy of the existing process. The new process is called a child process and the existing process is called a parent process.
<ResourceGroupTitle>Free Content</ResourceGroupTitle>
<BadgeLink colorScheme='red' badgeText='Watch' href='https://www.youtube.com/watch?v=PwxTbksJ2fo'>Understanding fork() system call for new process creation</BadgeLink>
<BadgeLink colorScheme='red' badgeText='Watch' href='https://www.youtube.com/watch?v=IFEFVXvjiHY'>fork() and exec() System Calls</BadgeLink>
<BadgeLink colorScheme='red' badgeText='Watch' href='https://www.youtube.com/watch?v=cex9XrZCU14'>The fork() function in C</BadgeLink>

@ -1 +1,7 @@
# Memory management
# Memory Management
Memory management is the process of allocating and deallocating memory. It is a very important part of any programming language.
<ResourceGroupTitle>Free Content</ResourceGroupTitle>
<BadgeLink colorScheme='red' badgeText='Watch' href='https://www.youtube.com/watch?v=vjYF_fAZI5E&list=PLrRW1w6CGAcXbMtDFj205vALOGmiRc82-&index=24'>MIT 6.004 L15: The Memory Hierarchy</BadgeLink>
<BadgeLink colorScheme='red' badgeText='Watch' href='https://www.youtube.com/watch?v=ajgC3-pyGlk&index=25&list=PLrRW1w6CGAcXbMtDFj205vALOGmiRc82-'>MIT 6.004 L16: Cache Issues</BadgeLink>

@ -1 +1,12 @@
# Lock mutex semaphore
# Lock / Mutex / Semaphore
A lock allows only one thread to enter the part that's locked and the lock is not shared with any other processes.
A mutex is the same as a lock but it can be system wide (shared by multiple processes).
A semaphore does the same as a mutex but allows x number of threads to enter, this can be used for example to limit the number of cpu, io or ram intensive tasks running at the same time.
<ResourceGroupTitle>Free Content</ResourceGroupTitle>
<BadgeLink colorScheme='yellow' badgeText='Read' href='https://stackoverflow.com/questions/2332765/what-is-the-difference-between-lock-mutex-and-semaphore'>What is the difference between lock, mutex and semaphore?</BadgeLink>
<BadgeLink colorScheme='yellow' badgeText='Read' href='https://stackoverflow.com/questions/34519/what-is-a-semaphore/40238#40238'>What is a Semaphore</BadgeLink>
<BadgeLink colorScheme='yellow' badgeText='Read' href='https://www.geeksforgeeks.org/mutex-vs-semaphore/'>Mutex vs Semaphore</BadgeLink>

@ -1 +1,5 @@
# Concurrency in multiple cores
# Concurrency in Multiple Cores
<ResourceGroupTitle>Free Content</ResourceGroupTitle>
<BadgeLink colorScheme='yellow' badgeText='Read' href='https://stackoverflow.com/questions/5372861/what-is-the-difference-between-multicore-and-concurrent-programming'>What is the difference between multicore and concurrent programming?</BadgeLink>
<BadgeLink colorScheme='yellow' badgeText='Read' href='https://cs.stackexchange.com/questions/140793/concurrency-in-multiple-core'>Concurrency in Multicore systems</BadgeLink>

@ -1 +1,15 @@
# Scheduling algorithms
# Scheduling Algorithms
CPU Scheduling is the process of selecting a process from the ready queue and allocating the CPU to it. The selection of a process is based on a particular scheduling algorithm. The scheduling algorithm is chosen depending on the type of system and the requirements of the processes.
Here is the list of some of the most commonly used scheduling algorithms:
- **First Come First Serve (FCFS):** The process that arrives first is allocated the CPU first. It is a non-preemptive algorithm.
- **Shortest Job First (SJF):** The process with the smallest execution time is allocated the CPU first. It is a non-preemptive algorithm.
- **Shortest Remaining Time First (SRTF):** The process with the smallest remaining execution time is allocated the CPU first. It is a preemptive algorithm.
- **Round Robin (RR):** The process is allocated the CPU for a fixed time slice. The time slice is usually 10 milliseconds. It is a preemptive algorithm.
- **Priority Scheduling:** The process with the highest priority is allocated the CPU first. It is a preemptive algorithm.
- **Multi-level Queue Scheduling:** The processes are divided into different queues based on their priority. The process with the highest priority is allocated the CPU first. It is a preemptive algorithm.
- **Multi-level Feedback Queue Scheduling:** The processes are divided into different queues based on their priority. The process with the highest priority is allocated the CPU first. If a process is preempted, it is moved to the next queue. It is a preemptive algorithm.
- **Lottery Scheduling:** The process is allocated the CPU based on a lottery system. It is a preemptive algorithm.
- **Multilevel Feedback Queue Scheduling:** The processes are divided into different queues based on their priority. The process with the highest priority is allocated the CPU first. If a process is preempted, it is moved to the next queue. It is a preemptive algorithm.

@ -1 +1,6 @@
# Cpu interrupts
# CPU Interrupts
CPU Interrupts are a way for the CPU to communicate with the rest of the computer. They are a way for the CPU to tell the rest of the computer that it needs to do something. For example, if the CPU is running a program and it needs to read from the keyboard, it will send an interrupt to the keyboard to tell it to send the data to the CPU. The CPU will then wait for the keyboard to send the data and then continue running the program.
<ResourceGroupTitle>Free Content</ResourceGroupTitle>
<BadgeLink colorScheme='red' badgeText='Watch' href='https://youtu.be/iKlAWIKEyuw'>Video on Interrupts</BadgeLink>

@ -1 +1,7 @@
# Processes vs threads
# Processes and Threads
Processes and threads are the basic building blocks of a computer program. They are the smallest units of execution in a program. A process is an instance of a program that is being executed. A thread is a sequence of instructions within a process that can be executed independently of other code.
<ResourceGroupTitle>Free Content</ResourceGroupTitle>
<BadgeLink colorScheme='yellow' badgeText='Read' href='https://www.quora.com/What-is-the-difference-between-a-process-and-a-thread'>What's the difference between Process and a Thread?</BadgeLink>
<BadgeLink colorScheme='red' badgeText='Watch' href='https://archive.org/details/ucberkeley-webcast-PL-XXv-cvA_iBDyz-ba4yDskqMDY6A1w_c'>Operating Systems and System Programming</BadgeLink>

@ -1 +1,7 @@
# Processes and threads
# Processes and Threads
Processes and threads are the basic building blocks of a computer program. They are the smallest units of execution in a program. A process is an instance of a program that is being executed. A thread is a sequence of instructions within a process that can be executed independently of other code.
<ResourceGroupTitle>Free Content</ResourceGroupTitle>
<BadgeLink colorScheme='yellow' badgeText='Read' href='https://www.quora.com/What-is-the-difference-between-a-process-and-a-thread'>What's the difference between Process and a Thread?</BadgeLink>
<BadgeLink colorScheme='red' badgeText='Watch' href='https://archive.org/details/ucberkeley-webcast-PL-XXv-cvA_iBDyz-ba4yDskqMDY6A1w_c'>Operating Systems and System Programming</BadgeLink>

Loading…
Cancel
Save