Lab10: ChatApp Design & Simple Threads

Concepts

  1. Java GUIs run in their own single thread. RMI runs in its own single thread. Your code will run in a third thread of its own. When communicating between threads, either through data accesses or function calls, you need to be careful.
  2. Java has provided a super-simple way to guarantee that any operation you may want to perform with GUI objects, can be executed in a thread-safe manner: SwingUtilities.invokeLater(…);
    SwingUtilities.invokeLater( new Runnable() {
    public void run() {
    // Your code here
    });
  3. Blocking Queues help the Producer-Consumer model of asynchronous processing work. Blocking Queues block the consumer, not the producer, allowing data to arrive as fast as it wants.
  4. The class then broke into groups to decide:
    1. What should the return value of a sent data packet RMI invocation be?
    2. What is the protocol for figuring out how to handle unknown commands?
  5. No decisions were reached.

Resources

  1. Lab 10 webpage: http://www.clear.rice.edu/comp310/f12/labs/lab10/
  2. More reading on Cross-Thread Invocations: http://www.clear.rice.edu/comp310/JavaResources/crossthread.html
  3. Group Design Brainstorms Wiki: https://owlspace-ccm.rice.edu/portal/tool/6207c4c3-bbc0-47d3-8161-8e88cf4286b2?pageName=%2Fsite%2FCOMP-310-F12%2Flab10&action=view&panel=Main&realm=%2Fsite%2FCOMP-310-F12