|
Have you validated the thread safety of your
code? Have you thrown into a debugger to see where the deadlock is
occurring?
Regards From: Phil Rosen [mailto:[EMAIL PROTECTED] Sent: Tuesday, November 14, 2006 4:55 PM To: [email protected] Subject: RE: [xfire-user] CPU usage skyrockets in XFire, not as java app. The sleep mechanism is
just to wait some time before checking the result_hash for the command result.
The worker threads can be paused, delaying execution of the command
queue. From: Brian
Lang [mailto:[EMAIL PROTECTED] Just for my
information, what is the sleep mechanism and push-pop type logic attempting to
accomplish? Regards From: Phil
Rosen [mailto:[EMAIL PROTECTED] So I have a method which is
implementing an observer pattern along the lines
of: static public
result_hash; static public
cmd_queue; Function String
getCmdResult(cmd){ cmd_queue.add(cmd.work) While(!result_hash.containsKey(cmd.key){
Thread.sleep(10); }
return
result_hash.remove(cmd_key); } This is exposed as a webservice via
extending XFireServlet. When I call this webservice, the CPU usage goes to 100%
and no result is returned. If I call this within a standard java app, it works
as anticipated. There are worker threads processing the cmd_que, they do stuff
and add the results to result_hash. The webservice just adds the work and waits
for the result. What is there in Xfire that could be making this fail? Is the
scope of static members limited in XFireServlets by
default? |
- [xfire-user] CPU usage skyrockets in XFire, not as java app. Phil Rosen
- Re: [xfire-user] CPU usage skyrockets in XFire, not as ... Paul Brown
- Re: [xfire-user] CPU usage skyrockets in XFire, not as ... Tomek Sztelak
- RE: [xfire-user] CPU usage skyrockets in XFire, not as ... Brian Lang
- RE: [xfire-user] CPU usage skyrockets in XFire, not as ... Phil Rosen
- Re: [xfire-user] CPU usage skyrockets in XFire, not... Paul Brown
- RE: [xfire-user] CPU usage skyrockets in XFire, not... Brian Lang
- RE: [xfire-user] CPU usage skyrockets in XFire, not as ... Phil Rosen
