Concepts
- 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.
- 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
});
- 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.
- The class then broke into groups to decide:
- What should the return value of a sent data packet RMI invocation be?
- What is the protocol for figuring out how to handle unknown commands?
- No decisions were reached.
Resources
- Lab 10 webpage: http://www.clear.rice.edu/comp310/f12/labs/lab10/
- More reading on Cross-Thread Invocations: http://www.clear.rice.edu/comp310/JavaResources/crossthread.html
- 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
This entry was posted on
November 6, 2012 at 2:48 pm and is filed under Labs. Tagged: hw08, rmi, threads. You can follow any responses to this entry through the RSS 2.0 feed.
Both comments and pings are currently closed.