• 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: [Q] efficient or good model for send/receive with streams scheduled in runloop?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Q] efficient or good model for send/receive with streams scheduled in runloop?


  • Subject: Re: [Q] efficient or good model for send/receive with streams scheduled in runloop?
  • From: Michael Ash <email@hidden>
  • Date: Thu, 29 Jan 2009 10:49:18 -0500

On Thu, Jan 29, 2009 at 10:16 AM, JongAm Park
<email@hidden> wrote:
> Thank you for your comment.
>
> Shawn Erickson wrote:
>>
>> A lock? As in NSLock, etc.? Why do you think you need a lock here
>> given it isn't multi-thread and the fact that IO appears to be driven
>> by a runloop which will serialize access for you.
>>
>>
>
> At first, I was not sure if the Run-Loop was implemented using thread or
> signal.
> So, I tried locking, but it turned out that it was not multithreaded from
> app programmer's point of view.
> It seems to be implemented using signal, so using lock was not helpful.

No, neither. A runloop uses neither threads nor signals. It's simply a
loop that runs waiting on various input sources. More info here:

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

Don't let the fact that it's in the Threaded Programming Guide confuse
you, runloops don't use threads.

Mike
_______________________________________________

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

References: 
 >[Q] efficient or good model for send/receive with streams scheduled in runloop? (From: JongAm Park <email@hidden>)
 >Re: [Q] efficient or good model for send/receive with streams scheduled in runloop? (From: Shawn Erickson <email@hidden>)
 >Re: [Q] efficient or good model for send/receive with streams scheduled in runloop? (From: JongAm Park <email@hidden>)

  • Prev by Date: Why does NSTableView stop responding to validateMenuItem: ?
  • Next by Date: Re: Why does NSTableView stop responding to validateMenuItem: ?
  • Previous by thread: Re: [Q] efficient or good model for send/receive with streams scheduled in runloop?
  • Next by thread: [pyobjc] Custom sheet and didEndSelector
  • Index(es):
    • Date
    • Thread