MATLAB and Java threads
MATLAB and Java threads
(OP)
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. :)





RE: MATLAB and Java threads
http:
However, action listeners launched from within Java methods do work. I just can't get the syncronization to work. Without doing any kind of wait, Java action listeners work fine. I don't know if the MATLAB callbacks will take care of the wait issue for me or not. Guess I'll find out.
Anyone else have any information about MATLAB and Java threads?