Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions W11D2/W11D2_BaoChenhao_note.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# MULTI-core/processor/computer

SMC/SMP/cluster/Grid/Cloud...

multi: shared memory, multi-CPU

UMA-NUMA

multiple spinlock, bus

- Avoid cache thrashing!
- Time sharing, the art of scheduling

"Gang scheduling" : A gang of related threads are scheduled as a unit, a "gang"

"Computational Graph": ->"A platform for ML"

"Distributed Shared Memory": Like page table, with indices

## Graph computing

relations between Nodes, allocation of resources,...

GraphChi

Speed up executing, space less, locality is good.

And we have algorithms.

Object-based middleware "**CORBA**"

Based on CORBA. Distributed systems.
32 changes: 32 additions & 0 deletions W3D2/W3D2_BaoChenhao_note.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
### Process & Thread

#### synchronize

- lock, mutex, semaphore
- mutex means: mutual exclusion.
- method 1: lock variable. if lock=0, lock=1 and run; if lock =1,wait til lock=0and then run.
- method 2: **Peterson.** Always try to let others run. Run when all else quit the competition.

Mutex
```c
pthread_mutex_lock(&mutex);
pthread_cond_wait(&cond, &mutex);
```

The second line is to avoid sleep with a mutex locked and to make it possible for the consumer to wake it.

#### Monitor
To solve the problem at language level. There will be only one procedure running at a time.

### process scheduling

#### Memory consistency

**memory barriers:** to protect the code sequences, which might be edit by compiler, tomasulo, etc..

#### scheduling

- Q: who's next?!
- according to priority.
- Avoiding locks
- Read-copy-update
24 changes: 24 additions & 0 deletions W7D2/W7D2_BaoChenhao_note.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Dead Lock

## Conditions

- 1. Mutual exclusion
- 2. Hold and wait
- 3. No preemption
- 4. Circular wait condition

## Solution

- Don't care!
- Detection and recovery. Let deadlocks occur, detect them, and then take action.
- Dynamic avoidance by careful resource allocation.
- Prevention, by structurally negating one of the four required conditions.

### Detection

Banker's algorithm

### Avoiding

- Resource Trajectories
- In numeric order