On 29 Jul 2009, at 21:39, David Ayers wrote:
With respect to the pthread patch for GNUstep, I'm still not convinced
that GNUstep only runs on platforms which are configured to use
pthreads
by default by the objc runtime. Yet I never got around to checking
the
history.
Can you suggest any platforms where GNUstep runs but there is no
pthread implementation? Note that it doesn't matter what libobjc
uses; it always uses some abstraction on top of the native threading
layer, and GNUstep should still use objc_mutex_lock when locking
runtime resources, just as you should use my_favourite_library_lock()
when locking resources provided by your favourite library,
irrespective of the threading library you use. Similarly, there is no
problem spawning Mach threads and POSIX threads on Mach platforms
(including OS X), as long as you make sure you don't pass a handle to
one to a function that expects the other.
By the way, I noticed when I was looking through the libobjc code that
it only contains stub implementations for condition variables in its
threading implementation for several platforms. This doesn't really
matter for libobjc, because it doesn't actually use condition
variables in any of the code; they may have been used for something in
the past, but now are not used (and, therefore, not tested) by any
libobjc code, so relying on them in GNUstep (which we currently do for
NSConditionLock) makes a lot less sense than using the platform's
pthread implementation, which is likely to be used and tested by any
threaded POSIX code.
David
_______________________________________________
Gnustep-dev mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/gnustep-dev