Recently, we have frequently received the issue of player complaints card progress bar. And the background shows that the execution queue and CPU usage are unusually high
The following code is called when using Xbean, based on the jdb of the call
There will be a globallock.acquire () at the time of setting xmlobject;
When multi-threaded concurrent settings xmlobject cause each other to wait for this globallock cause each thread stuck, queue execution efficiency is not high
So our current solution is to use string concatenation into XML temporarily without Xbean function
Public final Xmlobject set (Xmlobject src) {if (isimmutable ()) {throw new IllegalStateException ("Cannot set the Value of an immutable Xmlobject "); } xmlobjectbase obj = underlying (SRC); Typestoreuser NEWOBJ = this; if (obj = = null) {Setnil (); return this; } if (Obj.isimmutable ()) {Set (Obj.stringvalue ())); } else {Boolean nosyncthis = PreCheck (); Boolean nosyncobj = Obj.precheck (); if (monitor () = = Obj.monitor ()) {if (nosyncthis) {newObj = Setterhelper (obj); } else {synchronized (monitor ()) {newObj = Setterhelper (obj); }}} and else if (nosyncthis) {if (nosyncobj) {newObj = Setterhelper (obj); } else {synchronized (Obj.monitor ()) {newObj = Setterhelper (obj); }}}} else {if (nosyncobj) {synchronized (monitor ()) { NEWOBJ = Setterhelper (obj); }} Boolean acquired = FALSE; try {globallock.acquire (); acquired = true; Synchronized (monitor ()) {synchronized (Obj.monitor ()) {globallock.release () ; acquired = FALSE; NEWOBJ = Setterhelper (obj); }}} catch (Interruptedexception e) {throw new Xmlruntimeexception (e); } finally {if (acquired) {globallock.release (); }}}} return (Xmlobject) newObj; }
Address performance issues caused by the use of an official Xbean-2.4.0.jar library