Re: Thread safety tips
From: Christian Kaufhold (usenet_at_chka.de)
Date: 01/09/05
- Next message: Bryan Cooper: "Re: JTable to show several sets of data"
- Previous message: Nobody: "New GridBagLayout implementation"
- In reply to: John McGrath: "Re: Thread safety tips"
- Next in thread: John McGrath: "Re: Thread safety tips"
- Reply: John McGrath: "Re: Thread safety tips"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Sun, 9 Jan 2005 16:35:10 +0000 (UTC)
John McGrath <ng@jpmcgrath.net> wrote:
> On 1/7/2005 at 11:41:01 AM, Christian Kaufhold wrote:
>
>> > We are talking about Java, right? Java interfaces cannot specify that
>> > an implementation must be thread-safe. The documentation is not an
>> > interface.
>>
>> I do not understand what you mean by specify? How can non-abstract
>> methods specify thread-safety
>
> I do not understand your reference to "non-abstract methods". The methods
> of an interface are *abstract* by definition.
>
> Java interfaces specify the methods that an implementing class must
> define, including the types of the arguments they accept, the return type,
> and the checked exceptions that the methods may throw. But there is no
> way that they can specify thread safety.
So how can non-abstract classes (regarding interfaces just as purely
abstract classes) specify thread-safety? How can they do it without
a textual description of how the user of the class is supposed to
use the class's features?
>> trivial cases)?
>
> Interfaces cannot specify that a method is synchronized.
For a non-abstract method, one can make it synchronized. I really wonder
what you mean by "an interface cannot ensure thread-safety" - opposed to
what?
>> > We were talking about the methods that manipulate the Document's text:
>> > append(), insertString(), etc, and how they are called from JTextArea.
>>
>> Au contraire, you were talking about "JavaDocs for the Document
>> interface" (see above).
>
> No. You are taking my statement out of context. If you will re-read the
> thread, you should be able to understand the context.
Yes. In the context of calling Document methods (by JTextArea), you were
talking about Document documentation not mentioning thread-safety. I was
merely pointing out that in the documentation for "render", there is some
idea of thread-safety (though of course incomplete).
> You seem rather combative. Is there a reason for this?
I am angry at myself because I seem to be incapable to make myself understood.
Christian
- Next message: Bryan Cooper: "Re: JTable to show several sets of data"
- Previous message: Nobody: "New GridBagLayout implementation"
- In reply to: John McGrath: "Re: Thread safety tips"
- Next in thread: John McGrath: "Re: Thread safety tips"
- Reply: John McGrath: "Re: Thread safety tips"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|