That’s the problem, in a debugger and just run as a Java app it runs right, no deadlocks.

 

Im wondering if that run from the context of an XFire servlet, the scope of static members is different. So a worker thread may not add the command results to the instance result_hash that is being observed. Is there anyway to set the scope of an XFireServlet?

 


From: Brian Lang [mailto:[EMAIL PROTECTED]
Sent: Tuesday, November 14, 2006 5:25 PM
To: [email protected]
Subject: RE: [xfire-user] CPU usage skyrockets in XFire, not as java app.

 

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]
Sent: Tuesday, November 14, 2006 4:21 PM
To: [email protected]
Subject: RE: [xfire-user] CPU usage skyrockets in XFire, not as java app.

 

Just for my information, what is the sleep mechanism and push-pop type logic attempting to accomplish?

 

Regards

 


From: Phil Rosen [mailto:[EMAIL PROTECTED]
Sent: Tuesday, November 14, 2006 3:42 PM
To: [email protected]
Subject: [xfire-user] CPU usage skyrockets in XFire, not as java app.

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?

Reply via email to