essentiallytight
Computer
- Sep 1, 2005
- 2
Objective:
MATLAB script launches a Java Gui and gives control to the Gui. The Gui collects user data. The user presses a button and the Java method returns control to MATLAB.
Implementation:
The MATLAB script calls a user defined Java method. The Java method builds two threads. The first thread builds the Gui (with a button) and builds an Action Listener for the button. The second thread calls .wait(). When the Action Listener is invoked it calls .notifyall(). The waiting thread should wake up, complete, and the Java method that built the threads returns control to MATLAB.
Problem:
When .wait() is called the ActionListener goes dead and MATLAB locks up.
Question:
Why does the ActionListener go dead and MATLAB lock up? Does MATLAB change the ordinary operation of Java threads?
Additional details:
When my user defined Java method builds the new threads, .start() does nothing, I have to directly invoke .run(). Does this imply something is wrong with the threads?
Any way to fix this implementation or suggestions for another are very welcome! Thank you.
MATLAB script launches a Java Gui and gives control to the Gui. The Gui collects user data. The user presses a button and the Java method returns control to MATLAB.
Implementation:
The MATLAB script calls a user defined Java method. The Java method builds two threads. The first thread builds the Gui (with a button) and builds an Action Listener for the button. The second thread calls .wait(). When the Action Listener is invoked it calls .notifyall(). The waiting thread should wake up, complete, and the Java method that built the threads returns control to MATLAB.
Problem:
When .wait() is called the ActionListener goes dead and MATLAB locks up.
Question:
Why does the ActionListener go dead and MATLAB lock up? Does MATLAB change the ordinary operation of Java threads?
Additional details:
When my user defined Java method builds the new threads, .start() does nothing, I have to directly invoke .run(). Does this imply something is wrong with the threads?
Any way to fix this implementation or suggestions for another are very welcome! Thank you.