freetype
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [ft] freetype and multithread


From: david turner
Subject: Re: [ft] freetype and multithread
Date: Mon, 13 Feb 2006 13:51:30 +0100
User-agent: Thunderbird 1.5 (Windows/20051201)

Hello,

just use a distinct FT_Library object per thread, and everything should work
ok. We don't support finer parallelism for very good reasons, the first of them
being to keep the code simple.

Also, I don't really understand why the font loading/rasterization performance is your bottleneck; the performance of your cache should be where most optimizations
should happen.

regards,

- David Turner
- The FreeType Project  (www.freetype.org)


Erich Martin a écrit :
since I may soon need to use truetype fonts, I am looking to replace my
current Type1/CID-only font lib with freetype. I quickly hacked some glue
code around freetype to switch from the current lib and it worked fine.

I had however a problem when I tried to optimize the interface with my
application. This app is multithreaded and run on multi-processor machines.
In order to run at full speed, several threads needs to be able to
simultaneously render the same glyph from the same font at different sizes.
The font is loaded once and put in a cache (the glyphs too, of course). The
font is basically read-only data. Each thread then have its own "working
memory" & size info it pass to the font library API used to render a glyph.
I need to do this because :
*there can be a lot of threads and having fonts loaded multiple times will
require too much memory and decrease performances instead of using a common
read/write-locked huge cache
*rendering glyphs and copying them is basically the only work done by the
threads (they are writing a printing dataflow to bitmaps). Having a mutex on
the library or fonts will waste lot of cpu time, even if the cache have a
good hit/miss ratio (specially with eastern fonts where the ratio is always
lower)

How can I do that with Freetype ? The size info and the glyph slot seems to
be tied to the loaded font and the rendering pipeline doesn't look fully
reentrant. What is exactly the actual reentrance degree of freetype ? :
*library-level (simultaneous rendering from different fonts)
*font-level (simultaneous rendering of different glyphs from same font)
*glyph-level (simultaneous rendering of same glyph from same font)
And, if not reentrant, is there a lot of work to make it so, down to
glyph-level ?




_______________________________________________
Freetype mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/freetype


***********************************************************************************
Information contained in this email message is confidential and may be 
privileged, and is intended only for use of the individual or entity named 
above. If the reader of this message is not the intended recipient, or the 
employee or agent responsible to deliver it to the intended recipient, you are 
hereby notified that any dissemination, distribution or copying of this 
communication is strictly prohibited. If you have received this communication 
in error, please immediately notify the address@hidden and destroy the original 
message.
***********************************************************************************




reply via email to

[Prev in Thread] Current Thread [Next in Thread]