Index

SchoolNotes

  1. CS225
    1. Introduction
    2. Lesson 1
    3. Lesson 2
    4. Lesson 3
    5. Lesson 4
  2. CS251
    1. The Beginning
  3. CS180
    1. Introduction
    2. Midterm Revision
    3. Finals Revision
    4. CS251
    5. Memory
    6. ELF Format
    7. History of Computers
    8. Stuff to Research
    9. Quiz To-Do
    10. OS Architectures
    11. Week 3
    12. Week 4
    13. Week 5
    14. Week 6 (Threads)
    15. Week 7 (Scheduling)
    16. Week 8 (Thread Scheduling)
    17. Week 9 (Memory Management)

OLD SHIT

  1. CS225 (OLD ONE IGNORE THIS)
    1. OOP
      1. Inheritance
      2. R-Value References
    2. Misc Notes
    3. Size/Offsets of Structs/Classes
    4. Week 4
  2. CS200 (IGNORE THIS TOO)
    1. Introduction
    2. Scan Conversion
    3. Quiz 01
  3. GAM200 (YEAH, IGNORE THIS TOO)
    1. Notes

Week 5

Multi-core means that you can put into a single chip several CPUs. (Instruction-level parallelism) (does not mean multiple instructions per cycle, that's 90's tech)

Inter-Process Communication
Program reuse, both cooperation/independence, parallellism, OS needs (microkernel)
- Why do we need to have inter-process communication between processes?
- What is the challenge?
→ Between P0 and P1 there is hard modularity, which means that for P0 and P1, they are unable to access each other's memory directly.
- What are the use-cases?
→ 1st use case (Historical)
⇒ Multi-programming
⇒ Cooperating processes
• Ancestor idea to multithreading
→ Chain commands together
⇒ Piping
- Either the sharing or the transfer of data.

Communication within a process (uses soft modularity)
- Function calls
- Global variables

Types of IPC
- Pipes
→ Every process can create a pipe through the pipe command
⇒ Pipe takes in an array of 2 ints, 0 for reading, 1 for writing
• write(int fd, const char *, size_t);
- Message Passing
- Shared Memory

Unidirectional is essentially half duplex (ie one directional)

Every process has at least 3 files: stdin, stdout and stderr
If the process creates a pipe it would have 2 more files opened: PipeIn and PipeOut.

How does the parent process pass on stuff to the child process?
- All child processes inherit the open files of the parent.

dup(int fd)
duplicates fd on the lowest closed file descriptor.