[
https://jira.jboss.org/jira/browse/JBIDE-3461?page=com.atlassian.jira.plu...
]
Toma�¾ Zupan commented on JBIDE-3461:
---------------------------------------
I was so curious what is wrong here that I couldn't keep back. So I decided to learn
how to develope JBossTools. After installing, studying and debuging I find what is wrong.
The problem is in threading, more precisely in Memory Consistency Errors (look
http://java.sun.com/docs/books/tutorial/essential/concurrency/memconsist....). Because
writing and reading of the fTerminated variable in RuntimeProcess class is from the two
different threads, memory consistency error is happend. So the method
stopProcess.isTerminated() is returnig false all the time altough ProcessMonitor thread is
already set the fTerminated variable to true. The solution is to synchronize the reading
and writing of the fTerminated variable which is actually an eclipse bug. Here in my case
it is enough to put some thread function (like Thread.yield() or Thread.sleep(0)) in while
loop and stopProcess.isTerminated() would return true. But by Java specification this is
not guaranteed and could emerged in some other JVM.
The other problem here is that empty while loop wastes processor times. On link
http://java.sun.com/docs/books/tutorial/essential/concurrency/guardmeth.html you can see
some suggestions how to solve this problem.
After Jboss server shutdown from eclipse IDE the CPU time is
significantly increased
------------------------------------------------------------------------------------
Key: JBIDE-3461
URL:
https://jira.jboss.org/jira/browse/JBIDE-3461
Project: Tools (JBoss Tools)
Issue Type: Bug
Components: JBossAS
Affects Versions: 3.0.0.cr1
Environment: Vista x64; Eclipse 3.4.1_win32_x64; JBoss server 5.0.0 GA and JBoss
server 4.2.3 GA; Java 1.6.0_11 x64
Reporter: Toma�¾ Zupan
Assignee: Rob Stryker
Priority: Critical
Fix For: 3.0.0.CR2
If JBoss server (i.e. JBoss, a division of Red Hat/JBoss 5) is started and stoped from
Eclipse IDE, then after server is stoped, CPU of the eclipse process is significantly
incresed from 0% to 50%. If you repeat it again after second serven shutdown CPU time is
increased to 100%.
I tried the same procedure on generic JBoss 4.2 server runtime and there is no problem.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira