[prev in list] [next in list] [prev in thread] [next in thread] 

List:       batik-dev
Subject:    multi-threads and AWTGlyphGeometryCache
From:       "Nicolas Socheleau" <nsocheleau () opentext ! com>
Date:       2005-04-25 15:30:17
Message-ID: F8D42FAAA10F614FA268AC8FB2F6A5160146FBE1 () OTWATMX01 ! opentext ! net
[Download RAW message or body]

The fontCache member of AWTGVTFont is a static non-synchronized HashMap
and access to the AWTGlyphGeometryCache is also non-synchronized.

 

My test runs 50 threads each using one SVG Transcoder to produce jpeg
out of 20 svg files (for each thread). At some point, the glyph geometry
cache which contains a list of glyph geometry is corrupted. One of the
list becomes circular and some threads enter an infinite loop when
AWTGlyphGeometryCache.get() or AWTGlyphGeometryCache.rehash() is called.

 

Did anybody experience something similar? Is there something to be done
before using the SVG Transcoder in a multi-threaded environment?

 

Nicolas


[Attachment #3 (text/html)]

<html xmlns:o="urn:schemas-microsoft-com:office:office" \
xmlns:w="urn:schemas-microsoft-com:office:word" \
xmlns="http://www.w3.org/TR/REC-html40">

<head>
<meta http-equiv=Content-Type content="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 11 (filtered medium)">
<style>
<!--
 /* Font Definitions */
 @font-face
	{font-family:"MS Mincho";
	panose-1:2 2 6 9 4 2 5 8 3 4;}
@font-face
	{font-family:"\@MS Mincho";
	panose-1:2 2 6 9 4 2 5 8 3 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
	{margin:0in;
	margin-bottom:.0001pt;
	font-size:12.0pt;
	font-family:"Times New Roman";}
a:link, span.MsoHyperlink
	{color:blue;
	text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
	{color:purple;
	text-decoration:underline;}
span.EmailStyle17
	{mso-style-type:personal-compose;
	font-family:Arial;
	color:windowtext;}
@page Section1
	{size:8.5in 11.0in;
	margin:1.0in 1.25in 1.0in 1.25in;}
div.Section1
	{page:Section1;}
-->
</style>

</head>

<body lang=EN-US link=blue vlink=purple>

<div class=Section1>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>The fontCache member of AWTGVTFont is a static non-synchronized
HashMap and access to the AWTGlyphGeometryCache is also \
non-synchronized.<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>My test runs 50 threads each using one SVG Transcoder to
produce jpeg out of 20 svg files (for each thread). At some point, the glyph
geometry cache which contains a list of glyph geometry is corrupted. One of the
list becomes circular and some threads enter an infinite loop when \
AWTGlyphGeometryCache.get() or AWTGlyphGeometryCache.rehash() is \
called.<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>Did anybody experience something similar? Is there something
to be done before using the SVG Transcoder in a multi-threaded \
environment?<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>Nicolas<o:p></o:p></span></font></p>

</div>

</body>

</html>



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic