Re: Thread safety tips

From: Christian Kaufhold (usenet_at_chka.de)
Date: 01/09/05


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



Relevant Pages

  • Re: ATL and COM+
    ... this, or lets say, I want to specify, Library, or Server, or put the name of my ... >> the Timeout, also how to specify the default construct string, through ... >> attributes, like objectpooling, JIT, ConstructString. ... >> interfaces, but looking for the attributes to configure it. ...
    (microsoft.public.vc.atl)
  • Re: Module, plug-ins,..
    ... You can query the registry to get a list of the registered ... COM libraries in a particular category which you specify. ... you still have to design the interfaces ...
    (borland.public.delphi.non-technical)
  • here it is !
    ... the difficulty began when I did not specify ... It was TCP 135 that was the concern. ... >purposes (I know conceptual exploits about this port, ... list of network interfaces indexes ...
    (microsoft.public.security)
  • Re: how to import two .tlb uses same interface?
    ... Unless you specify no_namespace flag on #import directive, ... interfaces will be in different namespaces. ...
    (microsoft.public.vc.atl)