• 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
Follow-up: Cocoa thread-safety
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Follow-up: Cocoa thread-safety


  • Subject: Follow-up: Cocoa thread-safety
  • From: Steve Klingsporn <email@hidden>
  • Date: Fri, 25 Oct 2002 23:07:03 -0500

The following is written in the 10.2 Cocoa release notes:

New methods for performing selectors on the main thread

Sometimes a background thread must have the main thread perform some
work on its behalf. These are often UI-related things, like updating a
window's displayed state. Two new methods on NSObject, declared in
<Foundation/NSThread.h>, have been added in 10.2.

- (void)performSelectorOnMainThread:(SEL)aSelector withObject:(id)arg
waitUntilDone:(BOOL)wait modes:(NSArray *)array;
- (void)performSelectorOnMainThread:(SEL)aSelector withObject:(id)arg
waitUntilDone:(BOOL)wait;


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.

Any help would be appreciated. Thank you.

Steve
_______________________________________________
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: Nicholas Riley <email@hidden>
    • Re: Follow-up: Cocoa thread-safety
      • From: OS X AIBO <email@hidden>
References: 
 >Cocoa thread-safety (From: Steve Klingsporn <email@hidden>)

  • Prev by Date: Re: [OT] Help Viewer knows was: blows
  • Next by Date: Re: Progress Indicator problem
  • Previous by thread: Cocoa thread-safety
  • Next by thread: Re: Follow-up: Cocoa thread-safety
  • Index(es):
    • Date
    • Thread