discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Setter Gettor method style


From: Christian Edward Gruber
Subject: Re: Setter Gettor method style
Date: Wed, 14 Aug 2002 23:03:27 -0400

I don't think the thread was really about "thread safety" as much as a
specific issue of one race condition.
I suppose the proper way to do the internal getter would be to lock the
internals, retaining and autoreleasing before you unlock.

The problem with allowing the sender to guarrantee thread safety is that, in
this case, the object returned may not exist by the time you can execute a
lock on it.

regards,
christian.
----- Original Message -----
From: "Philippe C.D.Robert" <philippe.robert@gmx.net>
To: <pjb@informatimago.com>
Cc: <cgruber@israfil.net>; <discuss-gnustep@gnu.org>
Sent: Wednesday, August 14, 2002 4:18 PM
Subject: Re: Setter Gettor method style


> Hi,
>
> On Wednesday, August 14, 2002, at 09:53 PM, Pascal Bourguignon wrote:
> >> From: "Christian Edward Gruber" <cgruber@israfil.net>
> >> Date: Wed, 14 Aug 2002 07:15:48 -0400
> >>
> >> [...]
> >> Unfortunately untrue.  It is possible, and in a highly
> >> multi-processing box,
> >> [...]
> >> there.  It's not likely to fail, but it may fail.  If your code is
> >> multithreaded, then option number 2 is preferable.
> >> [...]
> >> No, this is not true if you are in a truly multithreading environment.
> >> [...]
> >
> > I agree,  in multithreading/multiprocessing environments,  the GNUstep
> > library is not clean, and the return([[target retain]autorelease]); is
> > one step toward a more correct solution.
>
> I don't really agree (maybe because I am coming from Irix/SGI where
> multithreading is an important, daily issue and not just a hypothetical
> case as in other environments...), either a solution is/has to be 100%
> threadsafe or it is clearly stated as not and then it is up to the
> developer using GNUstep to make it threadsafe. This retain/autorelease
> 'solution' is definitly not threadsafe, so why make the effort at all?
> You cannot have a 90% threadsafety and it would be very dangerous to
> address the problem using such an philosophy.
>
> ...but maybe I misunderstand your point here?
>
> -Phil
> --
> Philippe C.D. Robert
> http://www.nice.ch/~phip
>
>
>
> _______________________________________________
> Discuss-gnustep mailing list
> Discuss-gnustep@gnu.org
> http://mail.gnu.org/mailman/listinfo/discuss-gnustep
>
>






reply via email to

[Prev in Thread] Current Thread [Next in Thread]