cs 241 section (04/05/12). outline mp7 banker's algorithm

15
CS 241 Section (04/05/12)

Upload: rafe-mills

Post on 08-Jan-2018

220 views

Category:

Documents


1 download

DESCRIPTION

MP7 What is MapReduce? – Framework for Data Intensive Jobs

TRANSCRIPT

Page 1: CS 241 Section (04/05/12). Outline MP7 Banker's Algorithm

CS 241 Section(04/05/12)

Page 2: CS 241 Section (04/05/12). Outline MP7 Banker's Algorithm

MP7

• What is MapReduce?– Framework for Data Intensive Jobs

Page 3: CS 241 Section (04/05/12). Outline MP7 Banker's Algorithm

MapReduce

Page 4: CS 241 Section (04/05/12). Outline MP7 Banker's Algorithm

We give youmap()input map()map() reduce()

Page 5: CS 241 Section (04/05/12). Outline MP7 Banker's Algorithm

You need toPipe() and Select()Fork()

Page 6: CS 241 Section (04/05/12). Outline MP7 Banker's Algorithm

Pipes

Ps aux | grep “bash”

Page 7: CS 241 Section (04/05/12). Outline MP7 Banker's Algorithm

Chat Room with Fifo!Everyone: ssh

linux1.ews.illinois.eduTAmkfifo /tmp/chat

echo “a” >/tmp/chat

Student

cat /tmp/chattail -f /tmp/chat

Page 8: CS 241 Section (04/05/12). Outline MP7 Banker's Algorithm

Banker's Algorithm

Page 9: CS 241 Section (04/05/12). Outline MP7 Banker's Algorithm

Current Allocation

Can P2 request (A:3 B:0 C:0) ?

Pr Alloc Max Need Total

A B C A B C A B C A B CP0 1 2 0 7 5 3 6 3 3 12 6 6P1 2 2 4 3 2 5 1 0 1 AvailableP2 3 1 0 10 1 2 7 0 2 A B CP3 2 1 1 2 2 2 0 1 1 4 0 1P4 0 0 0 4 3 3 4 3 3

Page 10: CS 241 Section (04/05/12). Outline MP7 Banker's Algorithm

Current Allocation

Can P2 request (A:3 B:0 C:0) ?

Pr Alloc Max Need Total

A B C A B C A B C A B CP0 1 2 0 7 5 3 6 3 3 12 6 6P1 2 2 4 3 2 5 1 0 1 AvailableP2 3 1 0 10 1 2 7 0 2 A B CP3 2 1 1 2 2 2 0 1 1 1 0 1P4 0 0 0 4 3 3 4 3 3

Page 11: CS 241 Section (04/05/12). Outline MP7 Banker's Algorithm

Current Allocation

Can P2 request (A:3 B:0 C:0) ?

Pr Alloc Max Need Total

A B C A B C A B C A B CP0 1 2 0 7 5 3 6 3 3 12 6 6P1 2 2 4 3 2 5 1 0 1 AvailableP2 3 1 0 10 1 2 7 0 2 A B CP3 2 1 1 2 2 2 0 1 1 3 2 5P4 0 0 0 4 3 3 4 3 3

Page 12: CS 241 Section (04/05/12). Outline MP7 Banker's Algorithm

Current Allocation

Can P2 request (A:3 B:0 C:0) ?

Pr Alloc Max Need Total

A B C A B C A B C A B CP0 1 2 0 7 5 3 6 3 3 12 6 6P1 2 2 4 3 2 5 1 0 1 AvailableP2 3 1 0 10 1 2 7 0 2 A B CP3 2 1 1 2 2 2 0 1 1 5 3 6P4 0 0 0 4 3 3 4 3 3

Page 13: CS 241 Section (04/05/12). Outline MP7 Banker's Algorithm

Current Allocation

Can P2 request (A:3 B:0 C:0) ?

Pr Alloc Max Need Total

A B C A B C A B C A B CP0 1 2 0 7 5 3 6 3 3 12 6 6P1 2 2 4 3 2 5 1 0 1 AvailableP2 3 1 0 10 1 2 7 0 2 A B CP3 2 1 1 2 2 2 0 1 1 5 3 6P4 0 0 0 4 3 3 4 3 3

Page 14: CS 241 Section (04/05/12). Outline MP7 Banker's Algorithm

Current Allocation

Can P2 request (A:3 B:0 C:0) ? No?

Pr Alloc Max Need Total

A B C A B C A B C A B CP0 1 2 0 7 5 3 6 3 3 12 6 6P1 2 2 4 3 2 5 1 0 1 AvailableP2 3 1 0 10 1 2 7 0 2 A B CP3 2 1 1 2 2 2 0 1 1 5 3 6P4 0 0 0 4 3 3 4 3 3

Page 15: CS 241 Section (04/05/12). Outline MP7 Banker's Algorithm

Current Allocation

Can P2 request (A:3 B:0 C:0) ? No?Remember to subtract initial request from Need

Pr Alloc Max Need Total

A B C A B C A B C A B CP0 1 2 0 7 5 3 6 3 3 12 6 6P1 2 2 4 3 2 5 1 0 1 AvailableP2 3 1 0 10 1 2 7 0 2 A B CP3 2 1 1 2 2 2 0 1 1 5 3 6P4 0 0 0 4 3 3 4 3 3