You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-users@xmlgraphics.apache.org by Vijay Kumar V <vi...@gmail.com> on 2005/03/31 08:51:01 UTC

Re: Deadlock in batik

Hi Thomas,

Thanks for this tip. This has not only solved the problem but 
also increased the performance by 50%. 

Thanks again.

PS: (Sorry for late response but i was re-assigned this task after a long time).

Regards,
Vijay


On Tue, 01 Feb 2005 08:24:50 -0500, Thomas DeWeese
<Th...@kodak.com> wrote:
> Hi Vijay,
> 
>   I think the following patch will fix the problem.  Please
> report back if it does!  This would be a very odd case to happen
> but if your server was very busy I could see it happening.
> 
> Index: sources/org/apache/batik/util/SoftReferenceCache.java
> ===================================================================
> RCS file:
> /home/cvs/xml-batik/sources/org/apache/batik/util/SoftReferenceCache.java,v
> retrieving revision 1.8
> diff -w -u -r1.8 SoftReferenceCache.java
> --- sources/org/apache/batik/util/SoftReferenceCache.java       18 Aug
> 2004 07:15:50 -0000      1.8
> +++ sources/org/apache/batik/util/SoftReferenceCache.java       1 Feb
> 2005 12:36:38 -0000
> @@ -174,11 +174,17 @@
>              if (cache == null) return; // Can't really happen.
>              synchronized (cache) {
>                  Object o = cache.map.remove(key);
> -                if (this != o)
> +                if (this == o) {
> +                    // Notify other threads that they may have
> +                    // to provide this resource now.
> +                    cache.notifyAll();
> +                } else {
>                      // Must not have been ours put it back...
>                      // Can happen if a clear is done.
>                      cache.map.put(key, o);
>              }
> +
> +            }
>          }
>      }
>  }
> 
> Vijay Kumar V wrote:
> 
> > We are using batik api to generate images from svg content.
> > However, when we issue a multi threaded request to generate the
> > images, it is getting blocked in
> >
> > org.apache.batik.util.SoftReferenceCache.requestImpl method ( According
> > to the stack trace)
> >
> > Im attaching the stack trace with this email...
> >
> > Please let me know what needs to be done.
> >
> > Im using batik 1.5.1 on windows 2000 machine.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: batik-users-help@xml.apache.org
> 
>

---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org