240 likes | 349 Views
Distribuerte Objekter. Våren 2013 Professor II Eric Jul Forelesning F2 – 2012-01-28. Velkommen. Eric Jul, Professor II, til daglig: Bell Labs, Dublin, Ireland Hvem var her IKKE første gang?. Kontakt. ericbj@ifi.uio.no Haster? SMS til +45 40 25 16 50 Skypeid: ericbjul – efter aftale.
E N D
Distribuerte Objekter Våren 2013 Professor II Eric Jul Forelesning F2 – 2012-01-28
Velkommen • Eric Jul, Professor II, til daglig: Bell Labs, Dublin, Ireland Hvem var her IKKE første gang?
Kontakt • ericbj@ifi.uio.no • Haster? SMS til +45 40 25 16 50 • Skypeid: ericbjul – efter aftale. • Tor Ivar og Bjørn Erik: kan hjelpe med det praktiske
Hvad • Kurs om Distribuerete Objekter
Hvornår Følgende mandage: • 14/1 – 2013 • 28/1 – 2013 • 18/2 – 2013 NB: 10.15 - 17 • 18/3 – 2013 • 22/4 – 2013 Klokken 09.15 – 12 og 13 – 16 I alt 5 x 2 x 3 timer = 30 timer
Hvad Principper om distribuerete objekter. Anvender et gennemgående språk: Emerald. VIGTIGT: Emerald er et værktøj, et eksempel – Emerald er i sig selv IKKE formålet med kurs.
Materiale • Rapporter • Artikler www.emeraldprogramminglanguage.org www.sourceforge.org
Kontakt Eric: ericbj@ifi.uio.no Hasterdet, så: SMS til +4540251650 Skype: ericbjul
Kursopbygning VIGTIGT: learning-by-doing Fem moduler: • forelæsning • øvelser (vigtigt) • en størreopgave
Eksamen Nogleobligatoriskeopgaver, de sidste to med karakter, somtæller 1/3. Sidste 1/3 ermundtligeksamen
Modul 1: Emerald basics • Emeralds objektbegreb • constructors, classes • Interfaces/types • Immutable types Assignment: Install Emerald from SourceForge
Modul 1: Opgaver • Installer Emerald på din maskine • get language report and Emerald article “General Purpose Lanuage” • Skrivogkør “Hello, world” i Emerald • Skriv et Sieve program: Et objektsomacceptererdetførstetal, somdetfår, hereftervildetvideresendetil en kopi af sig selv, de tal, der IKKE hardetførstetalsom divisor. Send tallenefra 2 til 100 igennemsien!
Modul 1: Opgaver Hvor mange har: • installeret Emerald påegenmaskine? • kørt Hello World? • gennemførtalleopgaverne?
Modul 2: Concurrency, distribution • Hvorfor distribution erinteressant for alle! • Concurrency • Monitors • Distribution model • Distribution primitives Obligatoriskopgave: Småprogrammeringsopgaverom concurrency
Modul 3: Distribution Grundliggendeprincipper for distribution : • Remote References • RPC – remote procedure call • Implementation of RPC • Location concept • Simple mobility • Asynchronous operations in Emerald • Immutability and its uses
Modul 4: Advanced distribution Avancerede distribution: • Call-back concept: Node State Changes • Emerald Virtual Machine • Secure hash functions • Peer-to-peer • Napster/Nopester • Implementation of process mobility • Distributed Garbage Collection En størreprogrammeringsopgave
Modul 5: Større opgave • Heterogeneous mobility • Design Patterns: Proxy, Observer • Keys • Replication • Take-home exam • Planetlab En størreprogrammeringsopgave
Denne gang: • Hvorfor Distribution erinteressant for alle! • Concurrency in Emerald • Principles for concurrency • Distribution
Why Distribution? Trends: • Moore’s law (1965): transistors/cm2doubles every year • Modified Moore’s Law (1975): transistors/cm2doubles one to two years Consequence: Number of machine cycles has doubled every 1-2 years since 1959.
CPUs A consequence of Moore’s Law has been that CPUs from 1959 to 2005 increased in clock frequency at the same rate as the increase in transistors. However, from 2005 clock frequencies has leveled completely off at about 3 GHz. Instead, the number of cores doubles every 1-2 years. Summary: Cycles/second doubles every 1-2 years from 1959 to (estimated) 2018!
Speed of Light • Speed of light is approximately 300,000 km/s • Exact definition: c = 299,792,458 m/s in vacuum. • In copper and optical fiber: about 1/3 slower. In a nanosecond, light moves about 30 cm, i.e., about 1 foot, so 1 ns is a “light-foot”!
Latency If two machines are 3 meters apart, latency due to speed of light is approximately 10 nanoseconds ((3m) / (3x109m/s)) Now measure “distance” in CPU cycles: In 1980: Intel 8080 1MHz CPU: 1/100 cycle In 2005: Intel Pentium 3GHz CPU: 30 cycles
Exploding Universe Chocking Consequence: If any two computers at a fixed distance (in meters) are upgraded often then they will appear to move away from each other exponentially as measured in clock cycles. THUS everyone must use distributed techniques! The speed of light is, sadly,way, WAY too slow!
Opgavesæt II • Kør hi – ho • Programmer en barrier i Emerald, test med program derhar 4 processer, somventerpåbarrierengentagnegange, skriveudhver gang de prøver at passererogigennår de passerer. Endnu en process somudløserbarrieren 3 gange. Kørprogrammet. • Programmer en producer-consumer-med-buffer i Emerald. Send tallene 1-30 igennembufferen, hvor producer og consumer hhv. hver 3. og 5. gang venteri 100 ms (brugdelay). Lad bufferenudskrive, når den indsætter/fjerner et element. Brug array. Max 2 elementer. Afleveringsfrist, ?? Sendestil ??