Re: Threads in Apps
Re: Threads in Apps
- Subject: Re: Threads in Apps
- From: Ken Tabb <email@hidden>
- Date: Wed, 6 Jun 2001 17:16:50 +0100
And so it was that Mal Paine said on 6/6/01 2:21 pm:
>
> NSThread is not exposed in java. you are supposed to use ``native'' java
>
> threads. Apple did not obviously cover this in their java cocoa
documentation
>
> (i certainly can't find it). there are some oblique references to threading
>
> (e.g., posting an event in a subthread causes the event to be posted in the
>
> main thread's run loop), but that is about it...
>
>
Apple has made it quite clear that they won't document things that have
>
already been documented a zillion times. For Obj-C users, this means they
>
get to go to a UNIX store to buy a BSD book...Apple's definitely not gonna
>
reinvent the BSD wheel. For Java users, this means you get to go pick up
>
your favorite Java reference/manual and read up on threads. On a side note,
>
I definitely agree that Apple shouldn't redocument the common stuff...that
>
way they can focus their energy on the docs we *really* need for the cocoa
>
specific interfaces.
I'm not arguing whether they are right or wrong to take this stance, but
*where* and *when* have they made it quite clear that this is their
policy... clearly I'm missing out on that link.
Having said that, either I miss your point or I disagree. If you're
saying when it comes to threads (the subject of the mail), that Obj-C
users are expected to use BSD/POSIX threads, then why did Apple
're-invent the wheel' by making an NSThread at all? Is the criticism not
whether or not they should make an NSThread, but that they *have* done
that, and yet there's not too much info on how to best design your app
with NSThreads (re: my earlier e-mail). Sure we could read up about
designing a POSIX threaded app from one of the O'Reilly books (eg.
'Pthreads programming') but without knowing the difference between a
POSIX thread and an NSThread, it doesn't help. And some people (myself
included) would rather stick to NSThreads when using Cocoa (Obj-C in my
case), as it's more likely to be compliant with the rest of the AppKit /
FoundationKit than POSIX threads are. At least that's what I'm guessing.
I agree more generally about re-inventing the wheel... personally I would
rather Apple spent time making Cocoa (both Obj-C and Java) examples /
code / tutes / docs than making Swing examples for people learning (pure)
Java... they could just supply the Sun examples. Not that I'm accusing
Apple of doing this, I'm just explaining how I agree with you.
Ken
p.s. where are all the invented 'designing multithreaded NSThread-based
document apps' wheels stored? 8^)
---------
Ken Tabb.
Mac & UNIX C/C++/Java developer (Health & Human Sciences),
Machine Vision researcher/programmer (Computer Science),
University of Hertfordshire, England
http://www.health.herts.ac.uk/ken/
Certified non-Microsoft Solution Provider