• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Follow-up: Cocoa thread-safety
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Follow-up: Cocoa thread-safety


  • Subject: Re: Follow-up: Cocoa thread-safety
  • From: Nicholas Riley <email@hidden>
  • Date: Sat, 26 Oct 2002 00:39:11 -0500
  • Mail-followup-to: Steve Klingsporn <email@hidden>, email@hidden

On Fri, Oct 25, 2002 at 11:07:03PM -0500, Steve Klingsporn wrote:

> Unfortunately, NSThread is not available from Java, nor do these
> methods seem to be relocated as the Java counterparts often are. I
> suppose it might be possible to write some code that uses JNI or the
> Java Bridge to do this, but this violates my desire to keep everything
> Java. My timer approach works, but using 4% of the CPU to run a timer
> 4 times a second seems a bit extreme to me.

What about NSRunLoop?

public void performSelectorWithOrder( NSSelector aSelector, Object
target, Object anArgument, int order, NSArray modes)

I've never done any Cocoa-Java, but that looks like something you
could use to do what you want.

To offer a counterpoint, I am _so_ glad that Apple doesn't consider
threads the solution to everything. The runloop stuff handles about
90% of what you'd use threads for, and in a very elegant fashion for
typical event-driven apps IMO. Multithreading, especially in
languages with no memory protection, can be the cause of very
hard-to-debug problems.

--
=Nicholas Riley <email@hidden> | <http://www.uiuc.edu/ph/www/njriley>
Pablo Research Group, Department of Computer Science and
Medical Scholars Program, University of Illinois at Urbana-Champaign
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: Follow-up: Cocoa thread-safety
      • From: Steve Klingsporn <email@hidden>
References: 
 >Cocoa thread-safety (From: Steve Klingsporn <email@hidden>)
 >Follow-up: Cocoa thread-safety (From: Steve Klingsporn <email@hidden>)

  • Prev by Date: Re: Follow-up: Cocoa thread-safety
  • Next by Date: Re: Redistribution of /Developer/Tools components...
  • Previous by thread: Re: Follow-up: Cocoa thread-safety
  • Next by thread: Re: Follow-up: Cocoa thread-safety
  • Index(es):
    • Date
    • Thread