• 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: Threading!
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Threading!


  • Subject: Re: Threading!
  • From: Andreas Schwarz <email@hidden>
  • Date: Tue, 19 Mar 2002 15:07:09 -0800

I ran into this same problem a few months ago.

Your methods have to return "oneway void" instead of "void", as in this method I've pulled form my code:

- (oneway void)setNumberOfPreviewsToGenerate:(int)number {
// Blah blah blah
}

The "oneway" is needed so your main thread knows it doesn't have to wait for a reponse, or something like that. I had a hell of a time figuring that one out myself, took me hours...

Andreas Schwarz
http://homepage.mac.com/schwarz


Said Steven Frank:

...
There's a main thread for handling the GUI, and a worker thread sitting
in a runloop. I can call methods in both directions, it all works fine.

But when the main thread calls a method on the worker thread via the
NSConnection, it _waits_ for it to return, which defeats the whole
purpose of threading in the first place. What's the point of detaching
a thread if it runs synchronously?
...
_______________________________________________
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.

  • Prev by Date: Scripting a Cocoa app
  • Next by Date: An update and more questions
  • Previous by thread: Re: Threading!
  • Next by thread: Re: Threading!
  • Index(es):
    • Date
    • Thread