Re: Thread safety tips

From: John McGrath (ng_at_jpmcgrath.net)
Date: 01/08/05


Date: Fri, 07 Jan 2005 23:16:08 GMT

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.

> (just making them synchronized does not do anything except in
> trivial cases)?

Interfaces cannot specify that a method is synchronized.

> > 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.

You seem rather combative. Is there a reason for this?

-- 
Regards,
John McGrath


Relevant Pages

  • Re: RFC: Package == class == object type
    ... > I could reverse the parameter sequence so that the block type is ... have 'value 2' you still must specify a place holder, ... Which makes the interface less flexible in the future, ... lists, which need to be passed as references, in which case explicitly ...
    (perl.beginners)
  • IPin::QueryAccept fails to renderer
    ... I am trying to get IAMVideoAccelerator interface working... ... I'm creating a video decoder filter and finding it hard to get the VMR ... the documentation doesn't specify. ...
    (microsoft.public.win32.programmer.directx.video)
  • Re: A puzzling question
    ... > satisfy any IUnknown calls locally. ... Well, on a call to CoCreateInstance, you specify the interface you want ... would have to specify IID_IUnknown to the remote server's CoCreateInstance, ...
    (microsoft.public.vc.atl)
  • Re: A puzzling question
    ... >> satisfy any IUnknown calls locally. ... > Well, on a call to CoCreateInstance, you specify the interface you ...
    (microsoft.public.vc.atl)