Index

SchoolNotes

  1. CS225
    1. OOP
      1. Inheritance
      2. R-Value References
    2. Misc Notes
    3. Size/Offsets of Structs/Classes
    4. Week 4
  2. CS200
    1. Introduction
    2. Scan Conversion
    3. Quiz 01
  3. GAM200
    1. Notes
  4. CS180
    1. Introduction
    2. Memory
    3. ELF Format
    4. History of Computers
    5. Stuff to Research
    6. Quiz To-Do
    7. OS Architectures
    8. Week 3
    9. Week 4
    10. Week 5
    11. Week 6 (Threads)

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.