Έμβλημα Πολυτεχνείου Κρήτης
Το Πολυτεχνείο Κρήτης στο Facebook  Το Πολυτεχνείο Κρήτης στο Instagram  Το Πολυτεχνείο Κρήτης στο Twitter  Το Πολυτεχνείο Κρήτης στο YouTube   Το Πολυτεχνείο Κρήτης στο Linkedin

Νέα / Ανακοινώσεις / Συζητήσεις

The Secrets of Concurrency: Ομιλία στο Τμήμα ΗΜΜΥ, Τετάρτη 10 Μαρτίου, 11πμ

  • Συντάχθηκε 08-03-2010 22:13 από Michail Lagoudakis Πληροφορίες σύνταξης

    Email συντάκτη: lagoudakis<στο>tuc.gr

    Ενημερώθηκε: -

    Ιδιότητα: ΔΕΠ ΗΜΜΥ.
    Τετάρτη 10 Μαρτίου 2010, 11πμ
    Αμφιθέατρο Κτιρίου Επιστημών


    Ομιλητής: Dr. Heinz Kabutz

    Τίτλος: The Secrets of Concurrency

    Περίληψη

    From the first version of Java, we have been able to create multiple threads. Initially, this was mostly used for making our GUIs more responsive. For example, we would read a file using a separate thread from the main Swing thread, updating the GUI as to the progress. Running many active threads on one CPU seldom made the program faster, on the contrary, the swapping overhead frequently bogged down the machine. However, in the last few years, the speed increase of CPUs has not been the clock speed, but the number of cores on each chip. We are in a position now where we can get a job done much faster by splitting it between multiple threads. Unfortunately there is still a lack of understanding of the mysteries surrounding threading. This has caused programmers to write code that is fundamentally incorrect, not taking into account best practices for threading.

    In this talk, we look at ten laws that can help us to write more correct threaded code:

    1. The Law of the Sabotaged Doorbell
    We show how to manage the InterruptedException. Since they are thrown by several methods in Java 5, this is useful to know.

    2. The Law of the Overstocked Haberdashery
    Threads use up resources, even if they are not active, putting an upper limit on the number of threads in our system.

    2. The Law of the Xerox Copier
    Instead of returning original objects, we make copies and return those. Immutability makes it much easier to reason about concurrency.

    4. The Law of the Blind Spot
    Fields can be cached locally by threads to improve the performance of retrieving their value. Thus, if one thread modifies a field, the other threads might not see the updated value.

    5. The Law of the Leaked Memo
    The Java Memory Model allows the hotspot compiler to reorder statements, as long as the final result is still correct. This can lead to some results which seem logically impossible.

    6. The Law of the Corrupt Politician
    Data races can cause the best objects to become corrupt. They can be really difficult to detect and analyse. In this law, we look at how we can avoid these problems.

    7. The Law of the Micromanager
    Adding synchronization to our code can cause problems with contention, where threads are waiting for each other to execute a critical section.

    8. The Law of Cretan Driving
    The rules of the road for Java threading are quite strict, but not enforced by all of the Java Virtual Machines. Even though your code seems correct, it might still be wrong.

    9. The Law of Sudden Riches
    Sometimes a system has latent defects that are only seen every few months. When running the system on faster hardware, these defects are amplified and can happen more frequently.

    10. The Law of the Uneaten Lutefisk
    It is often possible to detect deadlocks in Java, but unfortunately it is impossible to recover cleanly. The only option is to analyze the problem that caused it and then restart the JVM.


    Σύντομο Βιογραφικό

    Heinz was born in South Africa in the early 70s and has lived since 2006 on the Akrotiri in Chania on the beautiful island of Crete. He is an independent researcher focusing on the Java Programming Language and has published almost 200 articles on advanced Java topics, ranging from concurrency to performance tuning to reflection. He has been a Java Champion since 2005. Heinz teaches Java classes to companies to fund his research activities. Heinz has spoken at numerous software engineering conferences, such as TheServerSide Java Symposium Las Vegas and Barcelona, Sun Tech Days Johannesburg, Frankfurt, London and Athens, JavaZone in Norway, JavaPolis in Belgium and Jazoon in Zürich.

© Πολυτεχνείο Κρήτης 2012