Is the java.awt.Font class thread-safe?

F

Frank LaRosa

Hi,

Is the Font class thread-safe? In particular I'm concerned about
calling the functions "canDisplayUpTo" and "deriveFont" concurrently
on the same Font object.

I realize that Swing and Awt aren't thread-safe in general, but I'm
using this in a strictly non-GUI application. Thanks.
 
T

Thomas Weidenfeller

Is the Font class thread-safe? In particular I'm concerned about
calling the functions "canDisplayUpTo" and "deriveFont" concurrently
on the same Font object.

In general, if it doesn't say so in the API documentations, a
method/class is not thread save by definition. It might be by accident,
but I would not bet on this. It might also happen that someone has just
forgotten to document thread-safety (the API docs are notoriously bad
at documenting threading behavior).

But by looking at Font, I would bet it hasn't been designed for
thread-safety at all.

/Thomas
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,534
Members
45,007
Latest member
obedient dusk

Latest Threads

Top