Re: [Q] efficient or good model for send/receive with streams scheduled in runloop?
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