[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Please test new NSLock implementation!
From: |
Fred Kiefer |
Subject: |
Re: Please test new NSLock implementation! |
Date: |
Sat, 05 Sep 2009 00:04:29 +0200 |
User-agent: |
Thunderbird 2.0.0.22 (X11/20090605) |
Scott Christley schrieb:
> On Sep 4, 2009, at 12:29 AM, Wolfgang Lux wrote:
>> Fred Kiefer wrote:
>>> What do others think, is it worthwhile to hide these implementation
>>> details via another indirection or not? I am still in favour of using an
>>> opaque data type here. On systems like FreeBSD where pthread_mutex_t is
>>> itself a pointer we could use that directly and on other systems we have
>>> one additional malloc and free call per mutex. And where the structure
>>> fits into your one or two words we could even put the value into the
>>> ivar directly.
>>
>> I absolutely agree with you here. The interface should not expose any of
>> the implementation details unless there is a really pressing need to do
>> so. I understand David's reasoning that the approach with an opaque
>> pointer may lead to additional cache misses on FreeBSD (and apparently
>> OpenBSD as well), but without hard figures -- i.e., benchmarks for real
>> world programs making intensive use of NSLocks that show a substantial
>> performance improvement -- I consider this kind of coding premature
>> optimization which should be avoided.
>>
>
> Why not fix any problems in the ObjC runtime source? The point of those
> interfaces was to hide thread implementation issues across platforms and
> provide all ObjC programs with thread capability.
The problem there is that the ObjC runtime doesn't include a recursive
lock mechanism. This is one of the strong points in David's code, he
uses the native pthread support for recursive locks, which makes
implementing NSRecursiceLock so much easier. Using pthread directly in
base is OK, but we should hide it from users of base and not spill it on
to user application code.
Fred
- Re: Please test new NSLock implementation!, (continued)
Re: Please test new NSLock implementation!, Richard Frith-Macdonald, 2009/09/02
Re: Please test new NSLock implementation!, Fred Kiefer, 2009/09/02
- Message not available
- Re: Please test new NSLock implementation!, Fred Kiefer, 2009/09/03
- Re: Please test new NSLock implementation!, Wolfgang Lux, 2009/09/04
- Re: Please test new NSLock implementation!, Scott Christley, 2009/09/04
- Re: Please test new NSLock implementation!, David Chisnall, 2009/09/04
- Re: Please test new NSLock implementation!,
Fred Kiefer <=
- Re: Please test new NSLock implementation!, David Chisnall, 2009/09/04
- Re: Please test new NSLock implementation!, Fred Kiefer, 2009/09/04
- Re: Please test new NSLock implementation!, SPUeNTRUP - Kai Henningsen, 2009/09/17
- Re: Please test new NSLock implementation!, Fred Kiefer, 2009/09/18
Re: Please test new NSLock implementation!, Richard Frith-Macdonald, 2009/09/06
Re: Please test new NSLock implementation!, Fred Kiefer, 2009/09/06