• 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
Multithreading and Mach ports
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Multithreading and Mach ports


  • Subject: Multithreading and Mach ports
  • From: John Love <email@hidden>
  • Date: Tue, 9 Dec 2008 15:36:09 -0500

Reference:

http://developer.apple.com/documentation/Cocoa/Conceptual/Multithreading/RunLoopManagement/chapter_6_section_5.html#/ /apple_ref/doc/uid/10000057i-CH16-SW7

I've got several questions since I'm just starting to investigate Mach Ports.

1) Why is +LaunchThreadWithPort: so designated, ie, a class method. It seems to me that as far as the specific code listings presented, a class method is not required? For example, [workerObj sendCheckinMessage:distantPort] could be replaced with [self sendCheckinMessage:distantPort] if LaunchThreadWithPort would be changed to an instance method.

2) Maybe the real question #1 is: What exactly is the object in the background thread, named workerObj ??

3) I've saved my most general question to last, at least for this trip: currently when I enter my method to start up my background thread or threads, I simply call (several times if I have multiple threads:

[NSThread detachNewThreadSelector:@selector(bgCalcThread:) toTarget:self withObject:nil]

If I have multiple background threads, I can use a NSMutableDictionary with multiple keys for inter-thread communication

So, what do Mach Ports give me that the above doesn't?


John Love Touch the Future! Teach!



_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Multithreading and Mach ports
      • From: Nathan Day <email@hidden>
    • Re: Multithreading and Mach ports
      • From: Jean-Daniel Dupas <email@hidden>
  • Prev by Date: Re: Text Not Anti-Aliased In NSView
  • Next by Date: Re: Quote in path name
  • Previous by thread: NSTextField + Drag'n'Drop
  • Next by thread: Re: Multithreading and Mach ports
  • Index(es):
    • Date
    • Thread