1 / 25

Letzte Chance!!!

Letzte Chance!!!. Exceptions Thread, Runnable Synchronized Wait, notify, notifyAll Thread States Semaphoren. JCSP Swing JOMP Linearizability History Amdahl‘s Law Atomic. Danke an Jeremia. Java [DIM=800,threads=1]: 2690 ms C++ [DIM=800,threads=1]: 1706 ms

Download Presentation

Letzte Chance!!!

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Letzte Chance!!! • Exceptions • Thread, Runnable • Synchronized • Wait, notify, notifyAll • Thread States • Semaphoren • JCSP • Swing • JOMP • Linearizability • History • Amdahl‘s Law • Atomic

  2. Danke an Jeremia Java [DIM=800,threads=1]: 2690 ms C++ [DIM=800,threads=1]: 1706 ms Java [DIM=800,threads=4]: 760 ms C++ [DIM=800,threads=4]: 432 ms Java [DIM=1000,threads=1]: 5265 ms C++ [DIM=1000,threads=1]: 4423 ms Java [DIM=1000,threads=4]: 1570 ms C++ [DIM=1000,threads=4]: 1114 ms Java [DIM=1100,threads=1]: 7714 ms C++ [DIM=1100,threads=1]: 6352 ms Java [DIM=1100,threads=4]: 2291 ms C++ [DIM=1100,threads=4]: 1599 ms Java [DIM=1500,threads=1]: 28747 ms C++ [DIM=1500,threads=1]: 19021 ms Java [DIM=1500,threads=4]: 7932 ms C++ [DIM=1500,threads=4]: 5004 ms Java [DIM=2000,threads=1]: 68808 ms C++ [DIM=2000,threads=1]: 43657 ms Java [DIM=2000,threads=4]: 18648 ms C++ [DIM=2000,threads=4]: 11104 ms

  3. Wie verhält sich folgendes Programm? Compiler Fehler Kein Schleifendurchgang Ein einziger Schleifendurchgang Läuft unendlich lange boolean b = true; while(b = true) b = false;

  4. Wie verhält sich folgendes Programm? Compiler Fehler Kein Schleifendurchgang Ein einziger Schleifendurchgang Läuft unendlich lange boolean b = true; while(b = true) b = false;

  5. Welchen Typ hat der Rückgabewert von Channel.one2one().in()? org.jcsp.lang.Guard org.jcsp.lang.ChannelOutput org.jcsp.lang.CSProcess java.io.InputStream

  6. Welchen Typ hat der Rückgabewert von Channel.one2one().in()? org.jcsp.lang.Guard org.jcsp.lang.ChannelOutput org.jcsp.lang.CSProcess java.io.InputStream

  7. Welches dieser Begriffe ist kein Keyword von OMP? critical single multiple schedule

  8. Welches dieser Begriffe ist kein Keyword von OMP? critical single multiple schedule

  9. Wo gibt es einen Compiler Fehler? Zeile 1 Zeile 2 Zeile 3 Zeile 4 1: Runnable r = newRunnable() {publicvoid run(){}}; 2: try { r.start(); 3: } finally { 4: thrownewNullPointerException(); }

  10. Wo gibt es einen Compiler Fehler? Zeile 1 Zeile 2 Zeile 3 Zeile 4 1: Runnable r = newRunnable() {publicvoid run(){}}; 2: try { r.start(); 3: } finally { 4: thrownewNullPointerException(); }

  11. Was ist das Prinzip des MVC Patterns? Die Verwendung von Listener, um innerhalb des Programms Events weiterzugeben. Das Model unabhängig vom GUI zu implementieren. Niemals getGraphics() auf einer Swing Komponente aufzurufen, sondern alles in der Methode paint(g) zu zeichnen. Die Synchronisation zwischen Threads und dem EDT mittels SwingUtilities.invokeAndWait(…).

  12. Was ist das Prinzip des MVC Patterns? Die Verwendung von Listener, um innerhalb des Programms Events weiterzugeben. Das Model unabhängig vom GUI zu implementieren. Niemals getGraphics() auf einer Swing Komponente aufzurufen, sondern alles in der Methode paint(g) zu zeichnen. Die Synchronisation zwischen Threads und dem EDT mittels SwingUtilities.invokeAndWait(…).

  13. Was führt zu einer Exception? synchronized(lock) { synchronized(lock) { lock.wait(); }} notify() auf einem Objekt aufzurufen, auf dem noch kein wait() aufgerufen wurde. notifyAll() auf einem nicht-synchronisierten Objekt aufzurufen. synchronized(lock) { lock.wait(); lock.wait(); }

  14. Was führt zu einer Exception? synchronized(lock) { synchronized(lock) { lock.wait(); }} notify() auf einem Objekt aufzurufen, auf dem noch kein wait() aufgerufen wurde. notifyAll() auf einem nicht-synchronisierten Objekt aufzurufen. synchronized(lock) { lock.wait(); lock.wait(); }

  15. Was ist der Output dieses Programm? -1 0 1 2 AtomicInteger i = newAtomicInteger(0); i.getAndSet(i.getAndIncrement()+i.getAndAdd(i.getAndDecrement())); System.out.println(i.get());

  16. Was ist der Output dieses Programm? -1 0 1 2 AtomicInteger i = newAtomicInteger(0); i.getAndSet(i.getAndIncrement()+i.getAndAdd(i.getAndDecrement())); System.out.println(i.get());

  17. i.getAndSet(i.getAndIncrement()+i.getAndAdd(i.getAndDecrement()));i.getAndSet(i.getAndIncrement()+i.getAndAdd(i.getAndDecrement())); i.getAndIncrement()+i.getAndAdd(i.getAndDecrement()) => ret=0, i=1 i.getAndAdd(i.getAndDecrement()) => ret=1 , i=0 i.getAndAdd(1) => ret=0 , i=1 i.getAndSet(0 + 0); => ret=1, i=0 ==> i.get() = 0

  18. Welchen Methoden in Java entsprechen die Methoden P() und V() aus der Semaphoren Theorie? P = demand(), V = restore() P = ask(), V = respond() P = power(), V = want() P = acquire(), V = release()

  19. Welchen Methoden in Java entsprechen die Methoden P() und V() aus der Semaphoren Theorie? P = demand(), V = restore() P = ask(), V = respond() P = power(), V = want() P = acquire(), V = release()

  20. Wie verhält sich folgendes Programm? NullPointerException IlleagalThreadStateException Startet unendlich viele Threads Startet zwei neue Threads t = new Thread() { publicvoidrun() { t.start(); } }; t.start();

  21. Wie verhält sich folgendes Programm? NullPointerException IlleagalThreadStateException Startet unendlich viele Threads Startet zwei neue Threads t = new Thread() { publicvoidrun() { t.start(); } }; t.start();

  22. Wie viele Zeilen hat die Klasse Thread?

  23. Wie viele Zeilen hat die Klasse Thread? 1841

  24. Vielen Dank 

More Related