D
Der Schüler mal wieder
Gast
Sers Leute ich hab da ne Aufgabe von der versteh ich net so viel, könnt ihr mir da mal lurz aushelfen pls.
Könnt ihr mir da kurz aushelfen pls?
MfG
Code:
(Thread Handling)
a) What is meant by a Thread ?
b) What means the phrase „synchronized” ?
c) What is meant by the phrase „Dead-Lock“ ?
d) Look at the class ThreadTest . Please specify the system output that will be printed when the main() method is started. How much time will the execution take approximately? Please explain your answer with the program flow.
e) Please change now the run() and main() methods in the class ThreadTest by changing the calls of the method „test()“ to the ones specified in the following table. What will happen ? Please find out changes in the output and execution time and explain.
run() main()
test() test()
test2() test()
test3() test()
test() test2()
test2() test2()
test3() test2()
test() test3()
test2() test3()
test3() test3()
f) Imagine you have a Vector that contain some String values. You access the Vector from within several different theads using add / insert / remove operations. In one separate GUI thread you display the whole content of the Vector in a list. Now you find out that sometimes some elements are missed in your displayed list and sometimes some entries are displayed twice. What is possible reason ? How could this be solved ?
Könnt ihr mir da kurz aushelfen pls?
MfG