[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Setter Gettor method style
From: |
Nicola Pero |
Subject: |
Re: Setter Gettor method style |
Date: |
Mon, 5 Aug 2002 12:36:58 +0100 (BST) |
> > The rule that says that you must retain the objects you need is
> > failproof in all cases.
>
> No. Obscure cases involving multiple threads could be constructed where
> [[foo retain] autorelease] worked properly but retaining it after it's
> been returned doesn't.
I don't see your point. If you use multiple threads, unless you have a
lock, your getter/setter methods are not thread-safe (and so are liable to
crash at any moment) no matter if you retain foo before or after it is
returned. Another thread can always be scheduled in such a perverse way
as to release foo after you've got its pointer, but before your retain
method implementation is executed - no matter where you do it, if in the
caller or in the getter.
I think multiple threads using getter/setter methods are outside the scope
of the discussion, since if you have multiple threads using getter/setter
methods concurrently, you need special care (a lock at the appropriate
level) in all cases, of which I don't see any mention in this dicussion.
- Re: Setter Gettor method style, (continued)
- Re: Setter Gettor method style, Alexander Malmberg, 2002/08/04
- Re: Setter Gettor method style, Pascal Bourguignon, 2002/08/04
- Re: Setter Gettor method style, Alexander Malmberg, 2002/08/04
- Re: Setter Gettor method style, Pascal Bourguignon, 2002/08/04
- Re: Setter Gettor method style, Pascal Bourguignon, 2002/08/04
- Re: Setter Gettor method style, Alexander Malmberg, 2002/08/04
- Re: Setter Gettor method style, Pascal Bourguignon, 2002/08/04
- Re: Setter Gettor method style, Alexander Malmberg, 2002/08/04
- Re: Setter Gettor method style,
Nicola Pero <=
- Re: Setter Gettor method style, Alexander Malmberg, 2002/08/05
- Re: Setter Gettor method style, Nicola Pero, 2002/08/05
- Re: Setter Gettor discussion got to a halt, Martin Häcker, 2002/08/05
- Thread xxx : tossing reply message zzz, David Dicanot, 2002/08/06
- Re: Setter Gettor method style, Christian Edward Gruber, 2002/08/14
- Re: Setter Gettor method style, Pascal Bourguignon, 2002/08/14
- Re: Setter Gettor method style, Philippe C . D . Robert, 2002/08/14
- Re: Setter Gettor method style, Christian Edward Gruber, 2002/08/14
Re: Setter Gettor method style, Nicola Pero, 2002/08/06