Software-Engineering Seminar, Summer 2016
AG Softech FB Informatik TU Kaiserslautern
Studenten
Fragen:
Studienfach?
Software-Entwicklung 3 geh¨ort?
Erfahrungen in Programmierung mit Nebenl¨aufigkeit?
Zum Beispiel Threads in Java?
Teilnehmer:
Epiphane Olivier Mahop Ma Noubi-si Frikha Yassine
Marcel M¨uller Natalie Renner Patric van Zwamen
Seminar Thema:
Programmierung von
nebenl¨aufigen und verteilten Systemen
Theoretische Konzepte und praktische Umsetzung in modernen Programmiersprachen.
Motivation: Rechenleistung nutzen
Quelle: Herb Sutter: The Free Lunch Is Over (Dr. Dobb’s Journal, March 2005)
Motivation: Verteilte Systeme
Web-Anwendungen
Verteilte Datenbanken und Rechenzentren
Autos und Flugzeuge beinhalten mehrere Prozessoren Industrie 4.0, Internet of Things, Cyber-Physical Systems
Motivation: Reaktionszeit f¨ ur Benutzer
J B u t t o n btn = new J B u t t o n(" S p e i c h e r n ") ;
btn.a d d A c t i o n L i s t e n e r(e - > { s a v e F i l e T o D i s k() ;
m a r k F i l e A s S a v e d() }) ;
Probleme
r o u t e r.get(’ / d a s h b o a r d ’, f u n c t i o n(req, res) { S t a t s.g e t M e m o r y U s a g e(f u n c t i o n(err, m e m o r y) {
S t a t s.g e t C P U U s a g e(f u n c t i o n(err, cpu) {
S t a t s.g e t U s e r R e t e n t i o n(f u n c t i o n(err, r e t e n t i o n) { res.r e n d e r(’ d a s h b o a r d ’, {
m e m o r y: memory, cpu: cpu,
r e t e n t i o n: r e t e n t i o n })
}) }) }) })
Source: https://www.terlici.com/2015/10/28/solving-node-callback-hell-asyncjs.html
s t a t i c c l a s s A c c o u n t { int m o n e y = 0;
A c c o u n t(int m o n e y) { t h i s.m o n e y = m o n e y; }
}
v o i d t r a n s f e r(A c c o u n t from, A c c o u n t to, int a m o u n t) { if (a m o u n t > 0 && f r o m.m o n e y >= a m o u n t) {
f r o m.m o n e y -= a m o u n t;
to.m o n e y += a m o u n t; }
}
v o i d t e s t() t h r o w s I n t e r r u p t e d E x c e p t i o n { A c c o u n t a = new A c c o u n t( 5 0 ) ;
A c c o u n t b = new A c c o u n t(0) ;
T h r e a d t1 = new T h r e a d(() - > t r a n s f e r(a, b, 40) ) ; T h r e a d t2 = new T h r e a d(() - > t r a n s f e r(a, b, 20) ) ; t1.s t a r t() ; t2.s t a r t() ;
t1.j o i n() ; t2.j o i n() ;
S y s t e m.out.p r i n t l n(a.m o n e y + " " + b.m o n e y) ; }
99904 mal “10 40”, 95 mal “30 20”, 1 mal “30 60”
s t a t i c c l a s s A c c o u n t { int m o n e y = 0;
A c c o u n t(int m o n e y) { t h i s.m o n e y = m o n e y; }
}
v o i d t r a n s f e r(A c c o u n t from, A c c o u n t to, int a m o u n t) { if (a m o u n t > 0 && f r o m.m o n e y >= a m o u n t) {
f r o m.m o n e y -= a m o u n t;
to.m o n e y += a m o u n t; }
}
v o i d t e s t() t h r o w s I n t e r r u p t e d E x c e p t i o n { A c c o u n t a = new A c c o u n t( 5 0 ) ;
A c c o u n t b = new A c c o u n t(0) ;
T h r e a d t1 = new T h r e a d(() - > t r a n s f e r(a, b, 40) ) ; T h r e a d t2 = new T h r e a d(() - > t r a n s f e r(a, b, 20) ) ; t1.s t a r t() ; t2.s t a r t() ;
t1.j o i n() ; t2.j o i n() ;
S y s t e m.out.p r i n t l n(a.m o n e y + " " + b.m o n e y) ; }
99904 mal “10 40”, 95 mal “30 20”, 1 mal “30 60”
s y n c h r o n i z e d
v o i d t r a n s f e r(A c c o u n t from, A c c o u n t to, int a m o u n t) { if (a m o u n t > 0 && f r o m.m o n e y >= a m o u n t) {
f r o m.m o n e y -= a m o u n t;
to.m o n e y += a m o u n t; }
}
v o i d t r a n s f e r(A c c o u n t from, A c c o u n t to, int a m o u n t) { s y n c h r o n i z e d (f r o m) {
s y n c h r o n i z e d (to) {
if (a m o u n t > 0 && f r o m.m o n e y >= a m o u n t) { f r o m.m o n e y -= a m o u n t;
to.m o n e y += a m o u n t;
} } } }
Themen
1 Communicating Sequential Processes (CSP)
2 Umsetzung von CSP in der Programmiersprache Go
3 Das Actor-Modell
4 Umsetzung des Actor-Modells in der Programmiersprache Erlang
5 Umsetzung des Actor-Modells in der Bibliothek Akka f¨ur die Programmiersprache Scala
Ziele des Seminars
Vertiefung in ein spezielles Thema im Bereich Software-Engineering/Software-Technik Selbstst¨andiges erlernen neuer Themen Verbessern von Pr¨asentations-F¨ahigkeiten
Aufgaben
Lesen und Verstehen des gegebenen Materials Suche nach zus¨atzlichen Materialien
Seminar-Papier schreiben
Sprache: Deutsch oder Englisch 5-10 Seiten, LNCS Template
Thema verst¨andlich f¨ur andere Studenten erkl¨aren Begutachten von 2 anderen Papieren
Abschluss-Pr¨asentationen 20-30 Minuten Pr¨asentation Plus Fragen und Diskussion
How to fail a seminar?
Plagiate
Versp¨atete Abgaben
Fehlen bei den Abschluss-Pr¨asentationen Schlecht geschriebenes Papier
Schlechte Pr¨asentation
Nicht-konstruktive Kritik an anderen Papieren Keine Absprache mit Betreuer
Zuweisung der Themen
1 Communicating Sequential Processes (CSP) Betreuer: Prof. Dr. Arnd Poetzsch-Heffter
2 Umsetzung von CSP in der Programmiersprache Go Betreuer: Peter Zeller
3 Das Actor-Modell Betreuer: Mathias Weber
4 Umsetzung des Actor-Modells in der Programmiersprache Erlang Betreuer: Mathias Weber
5 Umsetzung des Actor-Modells in der Bibliothek Akka f¨ur die Programmiersprache Scala
Betreuer: Malte Brunnlieb
N¨ achste Schritte:
Termin mit Betreuer machen Zeitplan erstellen
Struktur/ Entwurf f¨ur das Papier
Uberschriften + 1-3 S¨¨ atze pro Abschnitt
Grenzen abstecken (welche Grundlagen werden im Papier erkl¨art, welche vorausgesetzt?)
Beispiele?
F¨ur praktische Themen: Sprache verwenden, Beispiel programmieren.
Termine:
bis 27. Mai: Struktur des Papiers an Betreuer senden 6. Juni: Austausch von Theorie- und Praxis-Studenten
20. Juni: Papier einreichen zur Begutachtung durch andere Studenten 30. Juni: Abgabe der Kritik zu den 2 begutachteten Papieren
14. Juli (15:30-18:00): Abschlusspr¨asentationen 22. Juli: Abgabe des verbesserten Papiers